Help with email problem on deleted domain

kappler0

Member
Mar 21, 2004
10
0
151
Hello,

Here is the weird issue I hope you can help me with as i have exhausted my
knowledge to no avail.

The cpanel server has several domains and all seems to work fine.

I recently moved two domains to a new (physical) server.
The domains moved are targetmyad.com /.net (.net being host) I then transferred
all the files and got the site up on the new server. (this was a couple weeks
ago so I know dns is fully propogated)

The problem is that if i send an email from any other domain/account on the old cpanel server to
the new server (ie. subscribe(at)targetmyad.com) it bounces BUT it appears that it
is bouncing locally from the old cpanel server where the domain used to reside. (The domain was terminated through WHM) See the failure email header below: (i edited the "@" to (at) below)

Return-path: <>
Envelope-to: scott(at)scottkappler.com
Delivery-date: Wed, 28 Dec 2011 20:38:16 -0500
Received: from mailnull by neweffect.ipdesignint.net with local (Exim 4.69)
id 1Rg4wi-0006oM-JX
for scott(at)scottkappler.com; Wed, 28 Dec 2011 20:38:16 -0500
X-Failed-Recipients: subscribe(at)targetmyad.com
Auto-Submitted: auto-replied
From: Mail Delivery System <[email protected]>
To: scott(at)scottkappler.com
Subject: Mail delivery failed: returning message to sender
Message-Id: <[email protected]>
Date: Wed, 28 Dec 2011 20:38:16 -0500
X-EsetId: EEEAF222A1773B30B9AAAC
So i am wondering if something is lingering on the old cpanel server for the
targetmyad.com domain that is causing this? Any assistance would be greatly appreciated!

Scott
 

ruzbehraja

Well-Known Member
May 19, 2011
392
11
68
cPanel Access Level
Root Administrator
You need to check the DNS on the old server. It does not seem to have got the new NS and A records.

You can verify by doing a dig:

Code:
dig MX domainname.com @oldserver.com
Code:
dig any domainname.com @oldserver.com
 

kappler0

Member
Mar 21, 2004
10
0
151
Thanks!

I ran those and this is what was returned:
[email protected] [~]# dig MX targetmyad.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5_7.1 <<>> MX targetmyad.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34669
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;targetmyad.com. IN MX

;; ANSWER SECTION:
targetmyad.com. 38400 IN MX 5 mail.targetmyad.com.

;; Query time: 1625 msec
;; SERVER: 4.2.2.1#53(4.2.2.1)
;; WHEN: Thu Dec 29 10:42:22 2011
;; MSG SIZE rcvd: 53

[email protected] [~]# dig any targetmyad.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5_7.1 <<>> any targetmyad.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59681
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;targetmyad.com. IN ANY

;; ANSWER SECTION:
targetmyad.com. 38340 IN MX 5 mail.targetmyad.com.
targetmyad.com. 38340 IN NS ns1.targetmyad.net.
targetmyad.com. 38340 IN NS ns2.targetmyad.net.

;; Query time: 0 msec
;; SERVER: 4.2.2.1#53(4.2.2.1)
;; WHEN: Thu Dec 29 10:43:22 2011
;; MSG SIZE rcvd: 103

-- So, I am perplexed as this shows up - however, the ns1/ns2 are the new servers host? I looked in /var/named/ but do not see anything for this domain? How do i correct this?
Thanks a lot!
 

ruzbehraja

Well-Known Member
May 19, 2011
392
11
68
cPanel Access Level
Root Administrator
You should also be doing:

Code:
dig a mail.targetmyad.com @oldserverip
dig a mail.targetmyad.com @newserverip
Dont forget to put in the @NameServerIP

so that we can check which A record is the issue.

The A records for the corresponding MX should be XXX.XXX.218.10


==============

Before this you may want to do this:

Go to WHM on the old server >> Edit DNS Zone.

Search for the DNS Zone for the domain targetmyad.com which you migrated.

Update it with the new info and ensure that the MX option below is set to Remote.

This should also solve your problem, if I have understood what the issue is.
 

Brian

Well-Known Member
Dec 1, 2010
117
3
68
Texas
cPanel Access Level
Root Administrator
Go to WHM on the old server >> Edit DNS Zone.

Search for the DNS Zone for the domain targetmyad.com which you migrated.

Update it with the new info and ensure that the MX option below is set to Remote.

This should also solve your problem, if I have understood what the issue is.
ruzbehraja is spot on here. Well, updating the DNS records on the old server won't do anything -- but the update to "Remote Mail Exchanger" is the key part of his recommendation.

Basically what's happening is this:

When you send mail from the Old server to the domain on the New server, Exim checks its local configuration files to reference whether a domain is Local or Remote. If it's set as Local (Local Mail Exchanger) it doesn't even bother performing any DNS lookups (hence why the DNS changes wouldn't do anything). Instead, it just assumes mail is local and attempts delivery that way. By changing it to Remote (Remote Mail Exchanger) on the old server, the old server will then actually perform a DNS lookup to determine where mail should go. It'll discover it's the New server (assuming DNS on the new server is set correctly) and deliver there.
 

kappler0

Member
Mar 21, 2004
10
0
151
Thanks - I appreciate the input. One problem though.. The domain was deleted from the old server so no dns zones remain in WHM for that domain... Could they be in a txt file or something somewhere?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
It would be better to check for the domain being listed in /etc/localdomains on the machine:

Code:
grep domain.com /etc/localdomains
If it is in that file, remove it and re-run "/scripts/mailperm" then recheck the domain isn't being readded to /etc/localdomains file. If it is, then the domain / account didn't get fully deleted. Check if the domain is appearing anywhere in /var/cpanel/users/* location by then doing:

Code:
grep domain.com /var/cpanel/users/*
Above please replace domain.com with the domain name in both listed commands.
 

kappler0

Member
Mar 21, 2004
10
0
151
Thank you guys..
I did all you suggested with no success... all appeared correct!

However after running some other network tests it turns out the data center had stale routes on a network segment that caused the problem..

Appreciate the help anyway!