Connecting Postfix to the SMTP relay
Postfix configuration with Brevo SMTP
- For Postfix, you need to setup the SASL authentication. For that, you have to access the
/etc/postfix/sasl_passwd
file in the local postfix directory and add your SMTP credentials.
[smtp-relay.brevo.com]:587 USERNAME:master_password
- Use
sudo postmap /etc/postfix/sasl_passwd
to update the credentials insasl_passwd
. For username, you can put the master password from your Brevo account. You can find the master password in SMTP and API menu in the top-right. Next we will update themain.cf
file in Postfix.
relayhost = [smtp-relay.brevo.com]:587
if the relay does not allow IPv6 connections then you can adjust the value of inet_protocols
to IPv4 in the main.conf
file.
- You can now restart Postfix with the command
sudo service postfix restart
and send a test email by using the command below.
date | mail -s "Test Email" [email protected]
Note: In case of errors, check mailq or check in the log file for Postfix. If you receive an authentication error, then you may have entered incorrect credentials or the changes in sasl_passwd
file may not be saved.
Updated 11 months ago