Configuring server-side email delivery service for CentOS, Plesk, and Postfix
Use the following steps to configure your server to use SendGrid, the IBM Cloud® email delivery service as a smart host.
The following example is a standard IBM Cloud® OS Reload of CentOS 6.5 with Plesk 12 and Postfix. note}
Configuration
-
Locate your Postfix configuration file. A common location is
/etc/postfix/main.cf
. -
Open the main.cf file with a text editor and add the following to the configuration.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:_Your SendGrid Username_:_Your SendGrid Password_
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
-
Save and close the /etc/postfix/main.cf file.
-
Restart Postfix by using this command:
/etc/init.d/postfix restart
Troubleshooting
-
If you get the "no mechanism available" error, verify that you have all of the necessary libraries for authentication or encryption. You can install these libraries by using the following commands:
For Debian and Ubuntu, use this command:
apt-get install libsasl2-modules
For Red Hat and CentOS, use this command:
yum install cyrus-sasl-plain
After you install these libraries, use the same restart command:
/etc/init.d/postfix restart
-
If port 587 does not work, use port 2525 in the Postfix configuration. You might also need to open the configuration file
/etc/postfix/main.cf
and uncomment the following line:#tlsmgr unix - - n 1000? 1 tlsmgr