How to create a Mail Server using CWP

Creating a Mail System in Centos Web Panel.
Priyanka Sharma
Priyanka Sharma

Created: 06/02/2020 12:15 PM - Updated: 06/02/2020 12:15 PM

 A perfect mail system includes:

Prerequisites

For a perfect mail system  we require We’ll use  Postfix, Roundcube, MySQL for our email in a Centos7 server. but  we will use  Centos Web Panel that comes with all these preinstalled.

Procedure

1. Login to your Centos 7 box through SSH and install Centos Web Panel (CWP). It comes with all our needed software pre-installed making it much easier for us to create our mail server.

2. Install SSL certificate for the hostname.

Login to CWP as root. On the Navigation Pane, click Server Settings>>Change Hostname. Enter new hostname then click Change Hostname.

( A hostname must be an A record that we can ping and get a response. It must be created and pointed to the server’s IP.)

This SSL Certificate will allow your webmail to be accessible via https and will also be used for TLS/SSL encryption for your emails. Its Free Let’s Encrypt that auto renews.

The server automatically configures TLS on postfix config file.

3. Configure DNS records

a)Configure rDNS

At your server provider, configure PTR for the domain to be the server hostname. Most providers already have a working PTR pre-configured. But you can replace that with your server hostname. Changes might take upto 24hours to reflect.

b)Configure SPF

Login as root to CWP and on the Navigation pane, scroll down to SPF Manager. Fill the form with the heading Add SPF record with recommended settings as shown in the image below. Some fields will be left blank for now but if you have an extra mail server you wish to permit, you’ll add its IP and hostname on this form so its updated at the SPF. We’ll look into that concept later when we configure our backup MX server.

c) Configure DKIM

Remain logged in as root, on the Navigation pane, click DKIM Manager, select your domain name and click Add DKIM button.

4. Configure Antispam and Antivirus

CWP provides three free antispam fighting tools in SpamAssassin, ClamAV and Amavis. To enable these services go to the Navigation Pane and click MailServer Manager. Under Rebuild Postfix Configuration section, select AntiSpam/AntiVirus and click Rebuild Mailserver. Once done, Restart All Mail Server services.

This should configure everything for you in relevant config files.

Your mail server is now all set and you should now create email accounts for the domain added. To do this, simply go to the Navigation pane and click Email>>Email Accounts>>Add New Domain Email

To access the email, type SERVER_IP/webmail or  hostname/webmail

Well, now  we can test domain hosted on our mail server via mxtoolbox.com.


Was this article helpful?

0 Out of 0 Marked As Helpfull

Have more questions? Please Contact Us