Sending as different users [Postfix works, Exchange works, how can I do this in Exim]

Steini Petur

Well-Known Member
Apr 24, 2016
54
11
58
Iceland
cPanel Access Level
Root Administrator
Hi,

I have 2 mailboxes in cpanel:

[email protected]
and
[email protected]

I need [email protected] to be able to send as [email protected]. When I just set a new sender in Thunderbird, it sends just fine, but recipient sees the original @hasaids.com in headers anyway. I need that to be completely "white-labelled". If @hasaids.com sends as @fullblownaids.com, there shouldn't be any mentions of @hasaids.com in the headers.

Example below:

I have a mail account set up in cPanel with the name [email protected]. I don't send from this email address, I just use it as a storage. All other mail that goes to my real email address (like [email protected]) is forwarded to [email protected], so I receive all mail I need. That part is ok.

When I send an email, I always use the my primary mailbox for SMTP authentication. When the mail is delivered to @gmail.com address, here is what gmail user sees in headers:

ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass [email protected]hasaids.com header.s=default header.b=Mmlm4ibI;
spf=pass (google.com: domain of [email protected] designates xxx.xxx.xxx.xxx as permitted sender) smtp.mailfrom=[email protected]
Return-Path: <[email protected]fullblownaids.com>
Received: from mx.mailexchangeservice.com (mx.mailexchangeservice.com. [xxx.xxx.xxx.xxx])
by mx.google.com with ESMTPS id n7si463763wrs.340.2020.06.01.12.57.40
for <[email protected]>
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Mon, 01 Jun 2020 12:57:41 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates xxx.xxx.xxx.xxx as permitted sender) client-ip=xxx.xxx.xxx.xxx;
Authentication-Results: mx.google.com;
dkim=pass [email protected] ........

As you can see, there are headers that mention both fullbownaids.com and hasaids.com domains. I don't want the domain hasaids.com to be seen at all, this is internal and not for everybody else to see.

That is the problem.

I could sort that out in Exchange and Postfix in 10 minutes, now I've been looking for a solution for a second day and can't still find a correct way to do it. I've set this up on cPanel and I can't have this figured out

Anyone else know how to accomplish this.. It can be done in Postfix and Microsoft Exchange so it must be able to be done in Exim, I just haven't figured it out.

Thank you in advance
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,268
313
Houston
I believe you can do this by setting up an identity to send from in Webmail. From Roundcube go to Settings (the gear on the left-hand side) -> Identities -> Create

Here's how I created mine:

Screenshot at Jun 02 23-26-22.png
(You should be able to click the thumbnail to make it readable)

Now I will note that you will continue to see two headers that cPanel & WHM adds which reference the original sender:

Code:
X-Get-Message-Sender-Via: server.mydomain.com: authenticated_id: [email protected]
X-Authenticated-Sender: server.mydomain.com: [email protected]
These are added into /etc/exim.pl:

Code:
[[email protected] /]# grep -ir "X-Authenticated-Sender" /etc/exim*
/etc/exim.pl.local:    return "X-Get-Message-Sender-Via: " . ( $primary_hostname ||= Exim::expand_string('$primary_hostname') ) . ": " . get_sender_lookup_method() . "\n" . "X-Authenticated-Sender: " . ( $primary_hostname ||= Exim::expand_string('$primary_hostname') ) . ": " . get_sender_lookup();
And you *could* remove those but the customization to do so would be unsupported. There's an old thread that appears to still be relevant on this here: Remove X-Get-Message-Sender-Via header
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,268
313
Houston
Thank you so much @cPanelLauren for this solution, I believe this might work, this should hide the header and even if unsupported, it's at least one way to do it, really wish though that it was a part of the Tweak Settings :)
Yea even I got fooled and thought the tweak setting that is present would do it, thankfully I tested it before I responded to you. I'm really glad to have helped you find a solution to this!! Thanks!