Re: [exim] preserving original envelope recipient in two-pas…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Sam Hathaway
Päiväys:  
Vastaanottaja: Stanislaw Halik
Kopio: 
Aihe: Re: [exim] preserving original envelope recipient in two-pass SpamAssassin setup
On Feb 16, 2006, at 12:46, Stanislaw Halik wrote:

> Sam Hathaway <list.exim-users@???> wrote:
>
>> I've noticed that when mail is resubmitted to Exim after being
>> scanned, the "RCPT TO:" line is the rewritten recipient address, not
>> the original recipient address. So on the second pass, the original
>> recipient information is totally gone. This prevents my users from
>> filtering their mail using $original_local_part and $original_domain
>> in Exim filter files, or from getting useful information from
>> Envelope-to: headers.
>
> putting these into your pipe transport:
>
> #v+
> user = mailnull
> group = mail
> #v-
>
> should do the trick for 'From' and 'To' headers.


My From: and To: headers are not getting rewritten, so that's fine.

> i'm not so sure about
> the envelope sender, but when in doubt, use:
>
> #v+
> headers_add = "X-Original-To: ${lc:${local_part}}@${lc:${domain}}"
> headers_remove = X-Original-To
> #v-


That does get the information into a header, but I'd really like to
able to use $original_local_part and $original_domain in exim
filters, which requires the envelope recipient to be set correctly.

Something I might try (but it seems kinda scary) is to turn off
use_bsmtp in my pipe transport and define the format manually instead:

   message_prefix = \
     MAIL FROM:<$sender_address>\n
     RCPT TO:<$original_local_part@$original_domain>\n
     DATA\n
   message_suffix = \
     .\n
   check_string = "."
   escape_string = ".."


Would this work, or would it foul things up?
-sam