Tips to setup mail server completely in WHM/cPanel?

Chris Worner

Well-known member
Registered
Joined
Apr 15, 2016
Messages
612
Points
28
Hello everyone,

I've recently installed WHM/cPanel on my server and I'm looking for guidance on setting up a comprehensive mail server. I want to ensure that my websites can send and receive emails seamlessly on this server. Could you please share any guides or tips to help me achieve this?

Thank you in advance!"
 

Cheerag Nundlall

Well-known member
Registered
Joined
Oct 12, 2016
Messages
336
Points
18
Setting up a comprehensive mail server in WHM/cPanel for seamless email functionality involves a series of essential steps. First, ensure you've selected the right mail server software (Dovecot + Exim) in WHM's "Mailserver Selection" section. Next, configure DNS records properly by setting up MX records pointing to your server's IP address. These records are crucial for email routing.

With DNS in place, create email accounts for your domains through cPanel's "Email Accounts" feature. You can also set up email forwarders and autoresponders here. Make sure to secure your email communication by installing SSL/TLS certificates, which you can obtain through Let's Encrypt in cPanel.

To enhance email deliverability and security, implement SPF, DKIM, and DMARC records. These authentication mechanisms help verify your email's legitimacy and protect against spoofing. Additionally, fine-tune Exim mail server settings in WHM's "Exim Configuration Manager" to customize your email server's behavior. Regularly monitor email logs for any issues or unusual activities using WHM's log analysis tools. Don't forget to implement security measures and anti-spam solutions available in WHM to safeguard your mail server against threats. Regularly backup your email data using WHM's backup tools to prevent data loss.

Finally, thoroughly test your mail server by sending and receiving emails to ensure it functions correctly. Maintain documentation of your email server's configuration for reference and troubleshooting.

Enjoy your setups!
 

reginao

New member
Registered
Joined
Sep 18, 2025
Messages
2
Points
0
Hi! First, I think some congrats are in order :D Setting up a comprehensive mail server in WHM/cPanel is a great step. Some tips that may help:

- Go to “Mailserver Selection” section in WHM and make sure you're using the right software (Dovecot + Exim).
- Make sure your MX records are set up correctly to point to your server's IP address. Also don't skip the SSL/TSL certificate installation via Let's Encrypt in cPanel.
- Also check your SPF, DKIM, DMARC records

To test or know for sure if your websites can send and receive emails seamlessly on this server, you can try the free email deliverability test by Warmy.io (sorry can't paste the hyperlink yet as I'm fairly new here). You'll be given a list of email addresses (mixture of Yahoo, Gmail, Outlook) then you can send a test email. You'll receive a very detailed report on how much of your emails were received in the inbox, or spam, or bounced.

Hope this helps!
 

I Forgot

Member
Registered
Joined
Apr 19, 2016
Messages
24
Points
3
Setting up email in WHM/cPanel is pretty straightforward for basic functionality, but getting deliverability right takes a few extra steps. First, make sure your server has a proper hostname and PTR record (reverse DNS) set up correctly - this is critical because many email servers will reject mail from servers without proper reverse DNS. You can check this in WHM under "Change Hostname" and you'll need to contact your hosting provider or data center to set up the PTR record to match your hostname. Then in WHM, go to the email configuration section and enable SPF and DKIM for all domains, which helps prove your emails are legitimate and not spoofed.

For each domain you want to send email from, you need to add the proper DNS records. Go to the DNS zone editor and make sure you have MX records pointing to your mail server, an SPF record (usually something like "v=spf1 a mx ~all"), and the DKIM record that cPanel generates for you. You can find the DKIM key in WHM under "Email Deliverability" which also checks if everything is configured correctly and gives you warnings about what's missing. Also set up DMARC records to tell other mail servers what to do if your SPF or DKIM checks fail - start with a relaxed policy like "v=DMARC1; p=none" and monitor reports before getting stricter.

The tricky part is avoiding being flagged as spam or getting your IP blacklisted. Make sure you configure rate limiting in WHM to prevent spam bots from abusing your server if a website gets compromised. Use authentication for SMTP so random people can't relay through your server. Monitor your mail queue regularly and check blacklist databases to make sure your server IP isn't listed anywhere. If you're sending any volume of email, especially marketing emails, consider using a third-party SMTP service instead because shared hosting IPs often have bad reputations already, and one compromised account on your server can get the whole IP blacklisted. Also be aware that managing a mail server takes ongoing maintenance - you need to keep an eye on logs, update software, and deal with deliverability issues, so if email isn't critical to your business it might be easier to use Google Workspace or a similar hosted solution instead.
 

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top