Set Up Your Brevo Account
- While we could set up DKIM, SPF and DMARC DNS records for our mail server / domain, the likelihood is that your public IP is on one of the MX blacklists and you will struggle getting unlisted. What is more, if you are running your mail server on a ISP-provided non-static IP address, the address may change over time and you would face issues again. For this reason, it is best to use an SMTP relay.
- The advantage of using Brevo (formerly Sendinblue) is that they allow for 300 emails a day for free, an offering that is unmatched by other providers (like MailTrap, MailChimp, etc.).
- Once you create a free account on Brevo.com:
- Go to to Senders, Domains & Dedicated IPs page.
- Click on the ‘Add domain’ button and add your domain.
- If you use CloudFlare or a similar provider that Brevo supports, you can have Brevo add the required DNS records for you. Once done, you may have to wait a few hours for DNS to propagate.
- To set up your SMTP relay login with Brevo:
- Proceed to the SMTP & API keys section.
- Click on the button to ‘Generate SMTP Login and Master password’ (unless created already).
- Go to the ‘Senders’ section and add an authorized sender from your domain:
- Configure SMTP transactional relay with Brevo
- Go to Transactional → Email → Real time (here)
- Find the notice at the bottom in orange – click on the ‘Complete my profile’ button and provide the required details.
- Once the message Proceed to the verification step so that Brevo is awaiting some traffic. Leave the window open.
Configure Postfix With SMTP Relay
- Head to your Postfix’s main configuration file and scroll to the button to add the following:
sudo nano /etc/postfix/main.cf # NEW SECTION - Set up as SMTP relayhost + configuration # Host and port numbers: relayhost = [smtp-relay.brevo.com]:587 # Enforce SASL authentication smtp_sasl_auth_enable = yes # Location of the username and password smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd # Forbid anonymous use smtp_sasl_security_options = noanonymous # Opportunistic TLS - ask if available smtp_tls_security_level = may # Max header size limit (1 MB) header_size_limit = 1048576 # Max email size limit (19 MB). Brevo's limit is 20 MB message_size_limit = 19922944
- Check that your config is visible:
sudo postconf header_size_limit sudo postconf message_size_limit
- In case you get a warning message that one of these parameters are being overriden, it means that the main.cf file contains this directive already – please remove the duplicates.
- Define the credentials:
sudo nano /etc/postfix/sasl_passwd [smtp-relay.brevo.com]:587 [email protected]:your_password
- Run last check in case something is wrong and restart Postfix:
sudo postfix check sudo systemctl restart postfix
- Other useful commands:
# To rebuild the index file if you make changes to the sasl_passwd file: sudo postmap /etc/postfix/sasl_passwd # Flush an existing email queue sudo systemctl restart postfix # Remember to restart postfix after changes to the config files sudo systemctl restart postfix
Test SMTP Relay with Brevo Via RoundCube
- Now log into Roundcube and attempt to send out an email
- After sending it, check the log by running
sudo vi /var/log/mail.log
(press SHIFT + G to go to the end; then to exit the vim text editor, type : followed by q! and press enter to confirm the exit). - You can also check the Logs and Statistics section in Brevo: