Initally I tried setting up the smtp settings using yast, but received this message when sending a test email from the command line.
"SASL authentication failed; cannot authenticate to server smtp.sendgrid.net [108.168.190.109] : no mechanism available."
The root cause of the error is that in order for postfix to authenticate with sendgrid it requires that cyrus-sasl package be installed.
Install cyrus-sasl:
Create a Password File:
Add the line:
Save and close the file.
Configure Postfix:
There are six parameters which must be set in the Postfix configuration file main.cf.
relayhost, which specifies the mail relay host and port number. The host name will be enclosed in brackets to specify that no MX lookup is required.
smtp_use_tls, which enables (or disables) transport layer security.
smtp_sasl_auth_enable, which enables (or disables) SASL authentication.
smtp_sasl_security_options, which in the following configuration will be set to empty, to ensure that no Gmail-incompatible security options are used.
smtp_sasl_password_maps, which specifies the password file to use. This file will be compiled and hashed by postmap in a later step.
smtp_tls_CAfile, which specifies the list of certificate authorities to use when verifying server identity.
Add or modify the following values:
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/ca-bundle.pem
Save and close the file.
Edit the master config.
Uncomment (delete the pound sign) from the line which reads:
Save and close the file.
Compile and hash the password file:
Restart Postfix:
Send a test email:
A mail delivery status report will be sent to <root>.
To view report:
Add Comment