EXIM sender domain name instead of server name

ivan levente

Member
Apr 4, 2015
13
1
53
Romania
cPanel Access Level
Root Administrator
Hello,

It seems all of my e-mail are sent from my hostname DNS address: server.mydomain.com
Code:
Received: from server.mydomain.com
    by server.mydomain.com with LMTP
    id HbwxF822CV41fh0ALUhlrA
The hostname of WHM is indeed set to "server.mydomain.com" but I can't change that to "mydomain.com" because an account is added with that domain name. There is no other account on it though and both DNS names are linked to the same IP address.
Now is there any way to change this behavior to make the e-mail sender show as "mydomain.com" instead of "server.mydomain.com".

The reason I want to change this is because some hosts reject e-mails for which the sender DNS is different from the IP rDNS.
Please advise. Thanks.

Y24alvP.png
 
Last edited by a moderator:

ivan levente

Member
Apr 4, 2015
13
1
53
Romania
cPanel Access Level
Root Administrator
Well it seems I spoke too soon.

While I did manage to change the HELO name, the actual sender in the mail headers is still server.mydomain.com instead of mydomain.com
Code:
Received: from server.mydomain.com
    by server.mydomain.com with LMTP
    id BN6jF6X8Cl4IsCEALUhlrA
    (envelope-from <[email protected]>)
    for <[email protected]>; Tue, 31 Dec 2019 09:45:41 +0200
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Tue, 31 Dec 2019 09:45:41 +0200
Received: from [66.147.232.32] (port=54652 helo=mydomain.com)
    by server.mydomain.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
    (Exim 4.92)
Tried everything, nothing works. Where the hell can I setup the sender shown in the headers?
 

ivan levente

Member
Apr 4, 2015
13
1
53
Romania
cPanel Access Level
Root Administrator
Alright, so I got a lead on this from here: How do I change Exim4's primary_hostname on a Debian box?
This setting worked, the change was applied to exim:
Code:
Before:
[email protected] [~]# exim -bP primary_hostname
primary_hostname = server.mydomain.com

After:
[email protected] [~]# exim -bP primary_hostname
primary_hostname = mydomain.com
HOWEVER, when attempting to send an e-mail, I got the following logged in exim mainlog:
Code:
2019-12-31 11:08:01 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1imDVR-009K7x-F4
2019-12-31 11:08:01 1imDVR-009K7x-F4 ** [email protected]: Unrouteable address
So sending mail via SMTP doesn't work this way. Why the hell is the address "Unroutable"? Both main and subdomain have the same A record, so I don't get it.