Fix Email Issues in CyberPanel with SMTP Relay Setup (Free Method)
This will fix most common email delivery problems. You’ll learn to add an SMTP relay to your CyberPanel setup (or any other ubuntu postfix setup). This is usually a great improvement compared to trying to host your own SMTP server which is becoming very difficult in 2022.
Step 1: Set up a Cyberpanel Server with email, our video is here:
Step 2: Add the SMTP Relay with the video below here:
This setup will solve most issues where your VPS can’t send email, often because some hosts block port 25. Also, some setups that don’t provide reverse DNS will end up with lots of your email in spam.
We use Sendinblue to set this up, you can get started here: https://ideaspot.com.au/sendinblue
Commands we used in the tutorial are here, you can copy and right click to paste into putty.
Change to sudo and edit the postfix config:
sudo su -
nano /etc/postfix/main.cf
Scroll to the bottom of the config and paste in the additional config. If you’re not using Sendinblue, you should change the server address in the first line:
relayhost = [smtp-relay.sendinblue.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
Setup a password file:
nano /etc/postfix/sasl_passwd
Put your credentials into the file, you’ll need to change the server, email and password to match your own details:
[smtp-relay.sendinblue.com]:587 [email protected]:xsmtpsib-f46cf5b98745cba535588fc1535175c0dbbdb15632719b79a695a99c6f3586bf-vbOKyBJn2Wh90QSx
Finally, encrypt the password and change the permissions, then restart postfix:
postmap /etc/postfix/sasl_passwd
chown root:postfix /etc/postfix/sasl_passwd*
chmod 640 /etc/postfix/sasl_passwd*
systemctl restart postfix && systemctl enable postfix
Alternatives:
Or you can just avoid these above issues: Good hosts that allow port 25 & provide reverse DNS (Vultr or Contabo for example)
Vultr ➡️ (Free Trial) https://ideaspot.com.au/vultr
Contabo ➡️ https://ideaspot.com.au/contabo
Cyberpanel Server setup tutorials:
Vultr Setup: https://youtu.be/Nc4gU_X6j_w
Contabo Setup: https://youtu.be/m7vGDGHDSos