After domain migration cannot send email from Server 2 to Server 1

MindServer

Well-Known Member
Mar 18, 2020
246
32
28
Spain
cPanel Access Level
Root Administrator
Hi,

I have a domain "mydomain.com" which is used for server's create hostnames: hostname1.mydomain.com, hostname2.mydomain.com

I pointed this domain to a new server, the hostname and emails work correctly but the second server (hostname2.mydomain.com) cannot send emails to the firtst server (hostname1.mydomain.com, where point the domain "mydomain.com"). Always return this message:

SMTP<< 550 "REJECTED - Bad HELO - Host impersonating [hostname2.mydomain.com]

Other servers and computers can send emails to "hostname1.mydomain.com" without problems.

Why happens this?.

Thank you very much. Have a nice day.
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
576
266
138
IN
cPanel Access Level
Root Administrator
Delete all traces of mydomain.com on the old server from /etc/mailhelo, /etc/localdomains, /etc/remotedomains, and other if any.
 

MindServer

Well-Known Member
Mar 18, 2020
246
32
28
Spain
cPanel Access Level
Root Administrator
Hi,

I cleared data in the mentioned files in the old server but not solved the problem: /etc/mailhelo, /etc/localdomains, /etc/remotedomains

Any other file?, because "/etc/" directory have many folders and files.

Thank you very much. Have a nice day.
 

MindServer

Well-Known Member
Mar 18, 2020
246
32
28
Spain
cPanel Access Level
Root Administrator
Maybe this is a problem?:

1- I created subdomain hostname2.mydomain.com
2- Changed all record's IPs (A, MX, TXT, etc.) for the Server 2's IP.

Maybe should remove this subdomain and only create "A" record?. The hostname not need other records? (MX, TXT, etc.).

Thank you again.
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
576
266
138
IN
cPanel Access Level
Root Administrator
Yes, the subdomain for the hostname ( hostname2.mydomain.com ) not required

Maybe should remove this subdomain and only create "A" record?. The hostname not need other records? (MX, TXT, etc.).
Correct, Just add an A record for hostname2.mydomain.com to the main "mydomain.com" zone.
 

MindServer

Well-Known Member
Mar 18, 2020
246
32
28
Spain
cPanel Access Level
Root Administrator
Yes, the subdomain for the hostname ( hostname2.mydomain.com ) not required


Correct, Just add an A record for hostname2.mydomain.com to the main "mydomain.com" zone.
Thank you.

The problem is solved, I removed the subdomain and only created "A" record, now send emails.

But I have a new warning, hostname2.mydomain.com send email to hostname1.mydomain.com correctly but in file "/var/log/exim_mainlog" appear this warning:

[hostname1.mydomain.com IP] SSL verify error: certificate name mismatch: DN="/CN=hostname1.mydomain.com" H="mydomain.com"
Any idea about why happens this?. Thank you very much. Have a nice day.
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
576
266
138
IN
cPanel Access Level
Root Administrator
  • Like
Reactions: cPRex and cPDavidL

MindServer

Well-Known Member
Mar 18, 2020
246
32
28
Spain
cPanel Access Level
Root Administrator
Hi friend,

I did many tests and still have this error:

Code:
[hostname1.mydomain.com IP] SSL verify error: certificate name mismatch: DN="/CN=hostname1.mydomain.com" H="mydomain.com"
Can you check if you have this message in the file "/var/log/exim_mainlog" when hostname email account ([email protected]) send a email?

The email is sent correctly, but I always have this message in "exim_mainlog".

Thank you very much. Have a nice day.