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:
For Intel use:
CXXFLAGS="-arch x86_64" \
./configure
For PowerPC use
CXXFLAGS="-arch ppc64" \
./configure
Follow for both with:
sudo make install
Unpack the Postfix source into a directory, use the Terminal and ‘cd’ into the directory where you unpacked it. 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 -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’.
Next step: Building the Dovecot server in 64 bits on Leopard



9:38 pm
Hi richard,
Already a few steps further. When installing postfix I got following error :
This program built for powerpc-apple-darwin9.0
Report bugs to
Luc
8:18 am
Sorry about this, there was an issue with the ‘ characters. It’s solved now..
10:00 pm
Richard,
I am stumped. I am getting the following error when I compile postfix 2.7.1. ld warning: in /usr/local/lib/libpcre.dylib, file is not of required architecture
Undefined symbols:
“_pcre_malloc”, referenced from:
_dict_pcre_open in libutil.a(dict_pcre.o)
“_pcre_compile”, referenced from:
_dict_pcre_compile in libutil.a(dict_pcre.o)
“_pcre_study”, referenced from:
_dict_pcre_compile in libutil.a(dict_pcre.o)
“_pcre_free”, referenced from:
_dict_pcre_open in libutil.a(dict_pcre.o)
“_pcre_exec”, referenced from:
_dict_pcre_lookup in libutil.a(dict_pcre.o)
_dict_pcre_lookup in libutil.a(dict_pcre.o)
“_pcre_fullinfo”, referenced from:
_dict_pcre_open in libutil.a(dict_pcre.o)
“_pcre_get_substring”, referenced from:
_dict_pcre_expand in libutil.a(dict_pcre.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sendmail] Error 1
make: *** [update] Error 1
Based on what I am seeing it looks like it is in pcre. I have uninstalled the package and recompiled/reinstalled only to get the same error. I have scoured the net looking for solutions. Do you have any ideas?
Thanks!
Javier
5:28 am
@ Javier, this error happens when one of the parts is not compiled on the same manner. Meaning that you have something compiled for 32 or 64 bits but not for all components in the same manner. What platform are you compiling for?
5:37 am
Richard,
Thanks for the prompt response. I am compiling for 64 bit on a mac mini running 10.5.8. I started with a fresh install and have gone through the steps 7 times, from scratch and maybe another 3 or 4 from PCRE to postfix using make uninstall. I have copied and pasted the instructions as well as type them in. Each time I fail to compile at the exact same step. I am just about ready to just install it all as 32 bit but I REALLY want to figure out what I am doing wrong.
Thanks Again!
Javier