How to fix Dovecot/Postfix Issue/s with CyberPanel

Sending emails with CyberPanel does not work by default. Since the team of CyberPanel made it open-source, they didn't implement automatic configuration of Dovecot or Postfix. So, it needs to be modified/configured manually.

Let's start:

First of all, let's modify the postfix configuration (execute the following command on the terminal): nano /etc/postfix/main.cf

myhostname = server1.domain-name.tld
mynetworks = 127.0.0.0/8

Make sure to replace your own hostname with server1.domain-name.tld and the hostname should be pointed at the server's main IPv4. Also, replace your server's IP at mynetworks. If your server had a single IP, it should be with /32, or, add the whole IP with its range, if your server has multiple IPs. At the end of the /etc/postfix/main.cf file, add the following line:

tls_server_sni_maps = hash:/etc/postfix/vmail_ssl.map

Once it will be done, run the command to restart the Postfix service: service postfix restart

If you have a mail connection issue with SSL after performing the above changes, add the following lines to /etc/postfix/main.cf file (at the end):

smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem

Once done, again, save the changes and restart the Postfix service once more time.

 

Some tips for making sure that mail service works fine:

  • Make sure to add rDNS (Reserved DNS) from the server control panel so that the mail does not go to the spam folder/dir.
  • Also, the IP should be clean, if the IP is added any RBL, remove them (contact the service provider if you need further help)
  • An SSL certificate should be installed at the hostname (the hostname and rDNS should be the same if its a shared server)
  • Configure DKIM, DMARC, SPF, MX, and other TXT records that are used to validate the authentication of the domain correctly
  • Make sure to configure SMTP, POP3/IMAP correctly, and test mail results with mail-tester.com before onboarding your service!

If you need paid mail service, feel free to contact us! We're here to help you anytime!

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to restrict direct root access in Linux

We can do it just in two steps. Step One: At first we will create new root user as follows (for...

How to extract .tar.gz files in Linux/UNIX OS

A tarball is a group of files that are bundled together using the tar command. Use the...

How to add welcome message when SSH start?

You need to change the contents of /etc/motd. Unfortunately, by default, /etc/motd is a link to...

How to change root password when SSH logged in

Run the following command: passwd Now type your new passwordOnce done, retype new passwordDone!...

How to install Pinguzo on any Linux/UNIX OS

Login to Pinguzo panel using Softaculous account or create an account of Pinguzo To add new...