Re: [exim] Replace From with To for forwarded mails and also…

Top Page
Delete this message
Reply to this message
Author: John C Klensin
Date:  
To: Shamim Shahriar
CC: Exim-users
Subject: Re: [exim] Replace From with To for forwarded mails and also encapsulate email.


--On Monday, April 20, 2020 18:10 +0100 Shamim Shahriar via
Exim-users <exim-users@???> wrote:

> On 20/04/2020 17:34, Sebastian Nielsen via Exim-users wrote:
>> Correct, thats what I want to do. But ideally I want to also
>> replace the MIME From: in the email (but also preserve the
>> original one). By encapsulate the email.
>>
>> Check this email I send here. You see that its in a attached
>> .eml file. Mailman does this, but I want to implement
>> something similiar for exim, propably by using a system
>> filter.
>>
>> So a email that arrives like this and are bound for
>> fwdaccount@??? : ***************
>> MAIL FROM: hey@???
>> RCPT TO: forwarded@???
>> DATA
>> From: hey@???
>> To: forwarded@???
>> Subject: Hi!
>> Content-Type: text/plain
>>
>> Hey there!
>> ***************
>>
>> Is forwarded like this:
>> ***************
>> MAIL FROM: forwarded@???
>> RCPT TO: fwdaccount@???
>> DATA
>> From: forwarded@???
>> To: fwdaccount@???
>> Subject: Fwd: Hi!
>> Content-Type: message/rfc822
>>
>> From: hey@???
>> To: forwarded@???
>> Subject: Hi!
>> Content-Type: text/plain
>>
>> Hey there!
>> ***************
>>
>>
>
> Hi Sebastian
>
> As Jeremy has pointed out, that is NOT the task for the MTA.
> You can use various different additional programmes to do
> this. In fact, if I am not mistaken, asking the MTA to do what
> you are asking might even violate the RFC (appreciate if
> someone could please confirm).


For whatever it is worth, confirmed. While RFC 5321 has a lot
of language in it about exceptions for exceptional
circumstances, the intent is clearly (unless the author screwed
up) that MTAs simply do not tamper with whatever comes between
DATA (or equivalent) and that CRLF.CRLF except to add trace
fields at the top.

> Also, please think of the consequence. Most MUAs rely on the
> header data to do various fun things -- i.e., organise by
> thread, apply filters, and so on. To and From are not the only
> headers -- there are more to it. If you are putting all the
> former headers into the body -- what do you think is likely to
> happen? I can assure you that I, as a recipient, will be
> seriously unhappy and confused by that!
>...


Yep. There are cases in which one would want to completely
encapsulate a messages while/when forwarding it -- that is what
MIME's message/rfc822 and message/global are about -- but those
actions occur at MUA level, not the MTA one.

>...


-- your friendly RFC 5321 author and exim user.