How to Use an External/Remote Mail Server for a Domain Hosted on a cPanel Server

January 8, 2023 / cPanel & WHM

In this guide, we have explained how to use an external mail server for a domain hosted on a cPanel server. Let’s first define local and remote mail servers before continuing with the process.

Local mail server- Local mail server is a programme that receives incoming emails from nearby users and distant senders and forwards outgoing messages for delivery. It is also referred to as a mail transfer agent, or MTA; mail transport agent; mail router; or internet mailer.

Remote mail server- Remote mail servers deliver all mail sent to this domain to the mail service identified by the domain’s MX record using a remote mail exchanger. Deliver the emails to the mailbox on Google’s servers rather than your local mailbox, for instance, if you have Google set up as your mail service.

Note: 

1) If a domain’s nameserver is set to an external DNS server, get in touch with the DNS provider’s administrator and request that they change the MX record to point to a mail server.

2) If a domain uses a local mail server, an entry is added to the file below.

cat /etc/localdomains

3) If a domain makes use of an external email server like O365 and Google, entry of the domain gets added in the below file.

cat /etc/remotedomains

Follow the below steps to use an external mail server:

  1. Log in to WHM.
    Login
  2. Find the “DNS Function” option from the left-hand side of the screen and select the “DNS Zone Manager” sub-option under it.
    DNS Function
  3. You will enter a new page where you can select the domain. Select the domain and click on the “Manage” button.
    DNS Zone
  4. You will enter the “Zone records” for that domain.
  5. Click on the “Email Routing Configuration” option next to the “Actions” tab.

  6. You will enter a page where you will find email routing options. Select the “Remote Mail Exchanger” option.
    Remote Mail Exchange
  7. You can also directly add the MX entries from the interface given below and then click on the “Save” button.
    save
  8. You will get the final message as shown below.
    MX Entry

This way, any problems with emails attempting to be sent internally for a domain configured on your server running cPanel while that domain uses an external email service will be avoided.

Hope this article helped you. If you face any issues while executing this process, you can get in touch with our support staff at any difficult moment. They will surely help you out.

 

Spread the love