Skip to main content

How to Build Postfix + Dovecot Mail Server with Anti-Spam Solutions on CWP Server ?

By Default CWP server comes with Postfix + Dovecot + AntiSpam Solutions. We need to do some modifications on Postfix + Dovecot , for better security and high performance. In this series tutorials , We will learn how to build Postfix + Dovecot with AntiSpam Solutions .

Build CWP Mail Server
1. At first, We must have a valid FQDN with DNS Records (A & PTR). To generate new FQDN , Go to Server Settings >> Change Hostname .
We will 2048 key Size which is default or you can use 4096 key Size which is slower than 2048 key Size .
2. Build Postfix mail Server with AntiSpam/AntiVirus and  DKIM & SPF . Go to Email >> Mail Server Manager . Provide the FQDN and Domain then click on "Rebuild Mail Server"

3. Enable SPF & DKIM for parent Domain: Go to Email >> DKIM Manager 
Check also below the directory:
   TruestedHosts File Location: /etc/opendkim/TrustedHosts
   SigningTable File Location: /etc/opendkim/SigningTable
   KeyTable File Location: /etc/opendkim/KeyTable

4. Restart All Mail Server Services : Go to Email >> Mail Server Manager
# systemctl restart postfix
# systemctl restart dovecot
# systemctl restart spamassassin
# systemctl restart clamd
# systemctl restart amavisd 
5. Update ClamAv Database: Go to Email >> Mail Server Manager
# freshclam 
6. Enable CSF Firewall and Restart all CSF
7. Install SpamHause: Go to Email >> AntiSpam >> SpamHause
8. Restart CSF again
9. Install Softaculous: Go to Script Installers >> Scripts Manager >> Install Softaculous
10. Reboot the Machine and Check the log and Journal Entry for error .