[HOWTO] Postfix + SMTP AUTH + MySQL
Tested on: Fedora Core 4 (2.6.11-1.1369_FC4), MySQL-5.0.16
1.0 Getting the needed resources
Before installing postfix make sure the following packages are installed:
# up2date openssl
Download and install cyrus-sasl from this site, the cyrus-sasl version used in this HOWTO is 2.1.20
# mkdir /usr/src/cyrus-sasl
# cd /usr/src/cyrus-sasl
# wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.20.tar.gz
# tar zxvf cyrus-sasl-2.1.20.tar.gz
# cd cyrus-sasl-2.1.20
# ./configure --disable-krb4 --disable-gssapi --disable-otp
# make
# make install
# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
During the ./configure;make process, an error will occur like below:
client.c:64: error: static declaration of 'global_callbacks' follows non-static declaration
Locate the client.c file at /usr/src/cyrus-sasl-2.1.20/lib/ . Edit the file with your favourite editor find the statement "static sasl_global_callbacks_t global_callbacks;" and subsitute it as below:
# nano /usr/src/cyrus-sasl-2.1.20/lib/client.c
...
# Comment this line, remove the static keyword
#static sasl_global_callbacks_t global_callbacks;
sasl_global_callbacks_t global_callbacks;
...
Save the file, client.c. Re-run the command above.
Next, Postfix installation. Get the Postfix package and execute the following command:
# mkdir /usr/src/postfix/
# cd /usr/src/postfix/
# wget ftp://ftp.planetmirror.com/pub/postfix/official/postfix-2.2.7.tar.gz
# tar zxvf postfix-2.2.7.tar.gz
# cd postfix-2.2.7
The following command is to clean left over files from the previous build
# make tidy
#make makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH -I/usr/local/include/sasl -DHAS_MYSQL -I/usr/include/mysql" AUXLIBS="-lssl -lcrypto -L/usr/local/lib -lsasl2 -L/usr/lib/mysql -lmysqlclient -lz -lm"
Compile and install them
# make
# make install
Upon successful installation, you will be prompted to input some values. Just press 'enter' key to accept the default values.
1.0 Getting the needed resources
Before installing postfix make sure the following packages are installed:
- openssl-0.9.7f-7
# up2date openssl
Download and install cyrus-sasl from this site, the cyrus-sasl version used in this HOWTO is 2.1.20
# mkdir /usr/src/cyrus-sasl
# cd /usr/src/cyrus-sasl
# wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.20.tar.gz
# tar zxvf cyrus-sasl-2.1.20.tar.gz
# cd cyrus-sasl-2.1.20
# ./configure --disable-krb4 --disable-gssapi --disable-otp
# make
# make install
# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
During the ./configure;make process, an error will occur like below:
client.c:64: error: static declaration of 'global_callbacks' follows non-static declaration
Locate the client.c file at /usr/src/cyrus-sasl-2.1.20/lib/ . Edit the file with your favourite editor find the statement "static sasl_global_callbacks_t global_callbacks;" and subsitute it as below:
# nano /usr/src/cyrus-sasl-2.1.20/lib/client.c
...
# Comment this line, remove the static keyword
#static sasl_global_callbacks_t global_callbacks;
sasl_global_callbacks_t global_callbacks;
...
Save the file, client.c. Re-run the command above.
Next, Postfix installation. Get the Postfix package and execute the following command:
# mkdir /usr/src/postfix/
# cd /usr/src/postfix/
# wget ftp://ftp.planetmirror.com/pub/postfix/official/postfix-2.2.7.tar.gz
# tar zxvf postfix-2.2.7.tar.gz
# cd postfix-2.2.7
The following command is to clean left over files from the previous build
# make tidy
#make makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH -I/usr/local/include/sasl -DHAS_MYSQL -I/usr/include/mysql" AUXLIBS="-lssl -lcrypto -L/usr/local/lib -lsasl2 -L/usr/lib/mysql -lmysqlclient -lz -lm"
Compile and install them
# make
# make install
Upon successful installation, you will be prompted to input some values. Just press 'enter' key to accept the default values.

