Frequently, web developers often have to move their clients to new hosting environments. It can be a tiny move, or a huge move, depending on the requirements.
A great example of a small move is when you purchase hosting for your client, and then alter their zone file’s A Record to point to the new server (while leaving the rest in tact). It’s simple to do and gets the job done without providing much complication.
But complications CAN happen…otherwise I wouldn’t be writing this article! One such issue that is often encountered is email related. Your server is unable to send emails to its OWN DOMAIN.
Let’s use my website as an example. I try to use PHP to send an email to email@example.com, but it doesn’t go through! I can send to any other email address that uses a different domain though. Weird problem, huh?
This can happen for a variety of reasons, but one of the most simple reasons is that your server is trying to take control of your email that exists elsewhere.
In Plesk, you can fix this by going to the Mail tab -> Settings, and then unchecking “Activate mail service on domain”.
In WHM / cPanel, go to the mail section and click “MX Entry”. Then select the radio button for “Remote Mail Exchange”.
If you wish to do it through command-line, then it looks something like this:
/usr/local/psa/bin/domain -u yourdomain.com -mail_service false
Easy to fix, huh?