Connecting Postfix to the SMTP relay

Postfix configuration with Brevo SMTP

  1. 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.
[]:587 USERNAME:master_password
  1. Use sudo postmap /etc/postfix/sasl_passwd to update the credentials in sasl_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 the file in Postfix.
relayhost = []: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.

  1. 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.