Richard
Get the latest source code from www.postfix.org, check the blog for the latest tested version. I’m compiling Postfix with several options to help me achieve the flexibility and the security needed. We require the MySQL support for virtual mail box support, SASL for authentication and the SSL options to enable TLS support. Recently I found that PCRE support is also required if you want to use the complex filters in Postfix.
First you need to install the PCRE library (Perl Compatible Regular Expressions), to enable fancy filtering in Postfix. Download the source code from the site. You can compile and install it by running the following commands:
CXXFLAGS="-arch x86_64"
./configure
make
sudo make install
Unpack the Postfix source into a directory, use the Terminal and ‘cd’ into the directory where you unpacked it. When done Issue the following commands as a normal user:
CCARGS='-arch x86_64 -DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE=\"dovecot\" \
-DHAS_PCRE -I/usr/local/include \
-DHAS_SSL -I/usr/include/openssl \
-DHAS_MYSQL -I/usr/local/mysql/include/mysql' \
AUXLIBS='-L/usr/lib -llber -lresolv -L/usr/local/lib \
-L/usr/local/lib -lpcre -lssl -L/usr/local/mysql/lib/mysql \
-lmysqlclient -lz -lm'
To compile and install Postfix run:
For the questions that are asked at the end of the compilation accept the default values.
Please note that for the dependencies on directories I’m assuming you’ve got MySQL installed from my previous instructions in 64 bits. If not please check the location of the MySQL files mentioned in the configuration. You can find out which configuration on your system is active by running the command ‘mysql_config’.



Comments
9:20 am
Hi Richard,
Just a question. When you mention normal user, can this be the main user I use (administrator) or do I need to create a new one?
My main user is also the root user.
Rgds
Luc
9:26 am
Luc, the normal user is a regular OS X user account which can have an administrator role. You should not enable the root user (per default disabled on OS X) or use it on a daily basis, only use ‘sudo’ to execute commands with root privileges.
This is not OS X specific, but common practice on any unix platform.
10:57 am
Thanks,
That’s what I understood of it.
Luc
10:52 am
Hi.
I was getting an error like this when sudo make installing:
Undefined symbols:
“_db_version”, referenced from:
_dict_db_open in libutil.a(dict_db.o)
“_db_create”, referenced from:
_dict_db_open in libutil.a(dict_db.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [master] Error 1
make: *** [update] Error 1
which I’ve seen in a couple of places on this site. I read that these are apparently Berkeley DB errors, not mysql errors. I added a ‘-ldb’ to the end my AUXLIBS string and it compiled. FWIW
2:23 pm
Are you certain you want to disable something pertaining to name resolution when building postfix ?
In the postfix source, within dns.h , we see:
#ifdef RESOLVE_H_NEEDS_NAMESER8_COMPAT_H
#include
which is available from Apple,
http://opensource.apple.com/source/Libinfo/Libinfo-324/dns.subproj/
which is a subdirectory of
mac-os-x-1061 source code at the site.
Put
7:40 pm
@David, it was required to get this version of Postfix compiled on Snow Leopard. If you have another working solution I would love to hear about it.
4:33 am
Hi, I came across your site while troubleshooting this issue at my own site, but I did a bit of further digging and found that Mac OS X 10.6 no longer has an include file named nameser8_compat.h, which is the source of the issue. The equivalent file now seems to be arpa/nameser_compat.h. Updating the Postfix dns.h file (line 23) to include this file instead finally resulted in a good build, and so far seems to be running just fine here.
I’ve reported the issue to Wietse (Postfix author), the next build should properly check for Snow Leopard and compile properly using this change.
5:39 am
@Jim, thank you very much for this. Hope it will work out.
7:41 pm
You should’ve mentioned mysql first, for visitors from Google search!
I typed in all of the commands, then after that, read that “oh yeah, mysql should be installled from my previous post about something.”
So, natch it bailed on me. I’ll merrily download mysql and try to install that.
8:42 pm
@Kyle, sorry about this…
12:54 am
hello im getting this errors…
dict_mysql.c:396: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c:396: error: ‘HOST’ has no member named ‘type’
dict_mysql.c:398: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c:398: error: ‘HOST’ has no member named ‘ts’
dict_mysql.c:398: error: ‘HOST’ has no member named ‘ts’
dict_mysql.c: In function ‘dict_mysql_get_active’:
dict_mysql.c:447: error: ‘HOST’ has no member named ‘hostname’
dict_mysql.c:463: error: ‘HOST’ has no member named ‘hostname’
dict_mysql.c:465: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c: In function ‘dict_mysql_event’:
dict_mysql.c:479: error: ‘HOST’ has no member named ‘db’
dict_mysql.c: At top level:
dict_mysql.c:490: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
dict_mysql.c: In function ‘plmysql_connect_single’:
dict_mysql.c:542: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:544: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:545: error: ‘HOST’ has no member named ‘type’
dict_mysql.c:545: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:549: error: ‘HOST’ has no member named ‘port’
dict_mysql.c:550: error: ‘HOST’ has no member named ‘type’
dict_mysql.c:550: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:554: error: ‘HOST’ has no member named ‘hostname’
dict_mysql.c:555: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c:558: error: ‘HOST’ has no member named ‘hostname’
dict_mysql.c:558: error: ‘HOST’ has no member named ‘db’
dict_mysql.c: In function ‘plmysql_close_host’:
dict_mysql.c:566: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:567: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:568: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c: In function ‘plmysql_down_host’:
dict_mysql.c:577: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:578: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:579: error: ‘HOST’ has no member named ‘ts’
dict_mysql.c:580: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c: In function ‘host_init’:
dict_mysql.c:707: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:708: error: ‘HOST’ has no member named ‘hostname’
dict_mysql.c:709: error: ‘HOST’ has no member named ‘port’
dict_mysql.c:710: error: ‘HOST’ has no member named ‘stat’
dict_mysql.c:711: error: ‘HOST’ has no member named ‘ts’
dict_mysql.c:719: error: ‘HOST’ has no member named ‘type’
dict_mysql.c:723: error: ‘HOST’ has no member named ‘type’
dict_mysql.c:725: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:726: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:727: error: ‘HOST’ has no member named ‘port’
dict_mysql.c:728: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:730: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:731: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:732: error: ‘HOST’ has no member named ‘type’
dict_mysql.c:737: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:737: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:738: error: ‘HOST’ has no member named ‘port’
dict_mysql.c:738: error: ‘HOST’ has no member named ‘type’
dict_mysql.c: In function ‘plmysql_dealloc’:
dict_mysql.c:772: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:773: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:774: error: ‘HOST’ has no member named ‘hostname’
dict_mysql.c:775: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:776: error: ‘HOST’ has no member named ‘name’
make: *** [dict_mysql.o] Error 1
make: *** [update] Error 1
anybody have an idea>?
6:14 am
@Luke: Have you installed MySQL from source and which vrsion of MySQL did you install?
9:45 am
thank you for the fast reply
for now erased everything after it annoyed me at 3am in the morning.
but im looking for a solution….
i need a mail server with smtp and pop capabilities
cause we have alot of clients and we want to be able to send mass emails (mailserver for mac)
8:08 am
@Richard
Know it’s late, but I just had the same issue, when trying to build with MySQL 5.5.8 installed. I had to change the make line to remove the extra “mysql” after the -DHAS_MYSQL -I/usr/local/mysql/include/ and after -L/usr/local/mysql/lib/ so that the make command was like this:
make -f Makefile.init makefiles CCARGS=’-arch x86_64 -DUSE_TLS -DUSE_SASL_AUTH \
-DDEF_SERVER_SASL_TYPE=\”dovecot\” \
-DHAS_PCRE -I/usr/local/include \
-DHAS_SSL -I/usr/include/openssl \
-DHAS_MYSQL -I/usr/local/mysql/include/’ AUXLIBS=’-L/usr/lib -llber -lresolv -L/usr/local/lib \
-L/usr/local/lib -lpcre -lssl -L/usr/local/mysql/lib/ \
-lmysqlclient -lz -lm’
8:09 am
Sorry Luke, thought the poster was Richard. Should have gone to bed a long time ago…
8:54 am
@Chris, did you look at my blogpost on MySQL 5.5.x? http://diymacserver.com/2011/01/08/first-attempt-at-using-mysql-5-5-x/
It might answer your questions.
9:12 am
i fixed my problem by reinstalling the server and reordering the install stuff on the server
thank you for the help people