Forwarded emails sender

MaartenS

Verified User
Joined
May 23, 2013
Messages
7
Hello all,

I've just been sifting through 16 pages of search results, but haven't find an answer to this issue. Please point me in the right direction if I missed a thread.

To analyse my problem, please consider the following scenario.

[email protected] sends an e-mail to [email protected], where hostingpackage.com is a package hosted on a DirectAdmin server.
[email protected] is forwarded to [email protected], so that the path the email travels ends up to be:

[email protected] -> [email protected] -> [email protected]

But, the way the e-mail is actually sent is thus:
From: [email protected] To: [email protected], followed by From: [email protected] To: [email protected]

Now, this doesn't seem an issue at first, but the way our servers here are set up this is getting rather annoying. As well as DirectAdmin counting, our centralised outgoing mailserver also counts the amount of emails each domain sends daily. The problem is that our outgoing mailserver only sees From: [email protected], and so Gmail gets +1 for sent emails rather than hostingpackage.com.

See the following log-trail for details (IPaddresses/hostnames have been altered)

Code:
# grep '1UhGHj-00011v-Qy' mainlog ; the original message as arriving on the receiving mailserver at @hostingpackage.com
2013-05-28 11:33:39 1UhGHj-00011v-Qy <= [email protected] H=localhost (gmail.com) [127.0.0.1] P=esmtpa A=login:[email protected] S=833 [email protected] T="Forward test" from <[email protected]> for [email protected]
2013-05-28 11:33:41 1UhGHj-00011v-Qy => [email protected] <[email protected]> F=<[email protected]> R=lookuphost T=remote_smtp S=860 H=127.0.0.1 [127.0.0.1] C="250 2.0.0 Ok: queued as 64287B7B88FB"
2013-05-28 11:33:41 1UhGHj-00011v-Qy Completed


# grep '64287B7B88FB' maillog ; the message as it's relayed via our outgoing mailserver (cycled internal first)
May 28 11:33:39 mail postfix/smtpd[28282]: 64287B7B88FB: client=unknown[127.0.0.1]
May 28 11:33:40 mail postfix/cleanup[29877]: 64287B7B88FB: message-id=<[email protected]>
May 28 11:33:40 mail postfix/qmgr[5592]: 64287B7B88FB: from=<[email protected]>, size=1073, nrcpt=1 (queue active)
May 28 11:33:40 mail postfix/lmtp[30101]: 64287B7B88FB: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, conn_use=2, delay=1.6, delays=1.1/0/0/0.53, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=28084-05-2, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C6108B7B891B)
May 28 11:33:40 mail postfix/qmgr[5592]: 64287B7B88FB: removed

# grep 'C6108B7B891B' maillog | grep -v '64287B7B88FB' ; the message as it's being handed to and accepted by the recipient mailserver
May 28 11:33:40 mail postfix/smtpd[26284]: C6108B7B891B: client=localhost.localdomain[127.0.0.1]
May 28 11:33:40 mail postfix/cleanup[28657]: C6108B7B891B: message-id=<[email protected]>
May 28 11:33:40 mail postfix/qmgr[5592]: C6108B7B891B: from=<[email protected]>, size=1595, nrcpt=1 (queue active)
May 28 11:33:40 mail amavis[28084]: (28084-05-2) Passed CLEAN, [127.0.0.1] [127.0.0.1] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: ZD57TovnToNT, Hits: 1.31, size: 1073, queued_as: C6108B7B891B, 527 ms
May 28 11:33:41 mail postfix/smtp[27815]: C6108B7B891B: to=<[email protected]>, relay=localhost.localdomain[127.0.0.1]:25, delay=0.26, delays=0.15/0/0.02/0.08, dsn=2.0.0, status=sent (250 2.0.0 OK 1369733623 e4si5601698wja.208 - gsmtp)
May 28 11:33:41 mail postfix/qmgr[5592]: C6108B7B891B: removed

Now my question is obvious: how can we configure the (exim?) server in a way that the line
2013-05-28 11:33:41 1UhGHj-00011v-Qy => [email protected] <[email protected]> F=<[email protected]> R=lookuphost T=remote_smtp S=860 H=127.0.0.1 [127.0.0.1] C="250 2.0.0 Ok: queued as 64287B7B88FB"
will be changed to
2013-05-28 11:33:41 1UhGHj-00011v-Qy => [email protected] <[email protected]> F=<[email protected]> R=lookuphost T=remote_smtp S=860 H=127.0.0.1 [127.0.0.1] C="250 2.0.0 Ok: queued as 64287B7B88FB"
before sending but with a extra header 'originally from' or something so that [email protected] still sees [email protected] as the (original) sender? Is that even possible?

Many thanks for your thoughts on this.

Kind regards,
Maarten
 
Back
Top