Compile postfix with TLS And SASL for Sendgrid :-

Configure Postfix tar package for sendgrid & Compile postfix with TLS And SASL.
* Download these tar files cyrus-sasl-2.1.15.tar.gz, pfixtls-0.8.16-2.0.15-0.9.7b.tar.gz, postfix-2.0.15.tar.gz.
tar -xzvf cyrus-sasl-2.1.15.tar.gz
cd cyrus-sasl-2.1.15
./configure –enable-login=yes –with-dblib=none -disable-krb4 –disable-gssapi
make install
sh -c “echo pwcheck_method: saslauthd >/usr/local/lib/sasl2/smtpd.conf”
chmod 777 /usr/local/lib/sasl2/smtpd.conf
if already you installed sasl then move it has old or some other name
mv /usr/lib/sasl2 /usr/lib/
After this execute below Command,
ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
cd ..
hash -r
Compile the Tls With Postfix :-
tar -xzvf pfixtls-0.8.16-2.0.15-0.9.7b.tar.gz
tar -xzvf postfix-2.0.15.tar.gz
patch -p0 < pfixtls-0.8.16-2.0.15-0.9.7b/pfixtls.diff
Installing Postfix :-
cd postfix-2.0.15
yum install db4-devel.x86_64 (For DB)
make makefiles CCARGS=”-DUSE_SASL_AUTH -I/usr/local/include/sasl \
-DHAS_SSL -I/usr/local/include/openssl” AUXLIBS=”-L/usr/local/lib \
-R/usr/local/lib -lsasl2 -lssl -lcrypto”
make install (follow the instructions for configuration and install of the postfix)
ldd /usr/libexec/postfix/smtpd
the output is like
——————————- => (0x00007fff9f7c9000) => /usr/lib64/ (0x0000003fafa00000) => /usr/lib64/ (0x000000372ce00000) => /usr/lib64/ (0x000000372c600000) => /lib64/ (0×0000003737600000) => /lib64/ (0x0000003729e00000) => /lib64/ (0x0000003726e00000) => /lib64/ (0×0000003725200000) => /lib64/ (0x0000003725a00000) => /lib64/ (0x0000003727a00000) => /lib64/ (0x000000372b200000) => /lib64/ (0×0000003729200000) => /lib64/ (0×0000003728600000) => /lib64/ (0x0000003728e00000) => /lib64/ (0x0000003725e00000) => /lib64/ (0×0000003725600000)
/lib64/ (0x0000003724a00000) => /lib64/ (0x0000003727e00000) => /lib64/ (0×0000003729600000) => /lib64/ (0×0000003728200000) => /lib64/ (0×0000003726600000)
Default Postfix conf. files are installed to /etc/postfix/*
Create the CA Certificate :-
cd /etc/pki/tls/certs
make hostname.pem
Follow the instructions and give the details to create the CA Certificate.
cp hostname.pem /etc/postfix/
#vim /etc/postfix/ (In this my local system IP is (
inet_interfaces = (Ex: this is my local IP)
inet_interfaces = all
mydestination = $myhostname,$mydomain,
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
inet_protocols = ipv4
smtp_sasl_security_options = noanonymous
relayhost = []:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
smtp_tls_CAfile = /etc/postfix/hostname.pem
smtps inet n – n – – smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
mkdir /etc/postfix/sasl/
#vim /etc/postfix/sasl/passwd
[]:587 sendgridusername:sendgridpassword
chmod 600 /etc/postfix/sasl/passwd
postmap /etc/postfix/sasl/passwd
Reload or start the postfix
postfix reload or postfix start
To see the what are all the ports opened on our server.
netstat -tpln
see the log file for more details (for Mail status)
tail -f /var/log/maillog
Test Mail
subject:any thing
. ( for Exit)
after this check the logs “tail -f /var/log/maillog” Status should be sent like “status=sent”.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: