Posted by: paragon | November 2, 2008

MX Trouble ( Local & Remotedomains ) In CPanel

Source: http://jamessw.wordpress.com/2008/02/17/mx-trouble-local-remotedomains-in-cpanel/

MX Trouble ( Local & Remotedomains ) In CPanel

Posted on February 17, 2008. Filed under: cPanel / WHM |

In cPanel / WHM, in order to determine whether e-mail for a domain on the server, sent from the server, has to be processed locally or delivered externally ( i.e. at another MX ) the server maintains two files:

/etc/localdomains
/etc/remotedomains

When you change an MX record to an external server in cPanel, the system will remove your domain name from the /etc/localdomains file, and add it to the /etc/remotedomains file. However, in the event that you decide to move e-mail back to cPanel, and do this procedure inside cPanel, it will not remove your domain from /etc/remotedomains and add it back into /etc/localdomains ( stupid, isn’t it? ).

Therefore, you need to login to root via SSH and do the locomotion with me:

pico -w /etc/remotedomains

Find your entry, and delete it. Then exit and save this file. Then:

pico -w /etc/localdomains

And add your domain to the list. Exit and save. This will now allow messages generated by the server to be delivered locally. An exim restart may be necessary:

/etc/init.d/exim restart

Remember, if you don’t use your webservers nameservers ( cPanel’s DNS ) and have an external DNS company processing your mail elsewhere, you’ll need to remove your domain from /etc/localdomains and put it into /etc/remotedomains, so that any mail generated on the server itself, will be sent externally.

But I don’t get any locally sent messages?!?! Why does this change matter?!?! I’ve got butter on my face!!? But you do get locally sent messages! All of the e-mails from the server about disk space and bandwidth usage warning, password reset e-mails etc will not be delivered if you don’t make this change. Also, if user john@yourdomain tries to e-mail jake@yourdomain and uses cPanel’s smtp, this too will not be delivered correctly. it’s therefore essential that you keep the records up to date.

And whilst you’re in root messing around with exim…
Why not “tail /var/log/exim_mainlog” for a while to see how smooth your mail flow actually is. Log into WHM and take a look at the e-mail queue, see if anything’s sticking anywhere. Constant vigilance is the key to running a smooth server, and if you’re logged in, you might aswell check everything else is working correctly whilst you’re there.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: