Auteur: Phil Pennock Date: À: John Horne CC: Exim users Sujet: Re: [exim] Logging rewritten addresses
On 2013-08-23 at 17:09 +0100, John Horne wrote: > Hello,
>
> Using Exim 4.80.1 I am logging rewritten SMTP addresses using
> 'log_selector = +address_rewrite' and the 'S' rewrite flag.
>
> As an example of what is logged:
>
> ===================
> 2013-08-23 16:34:37 "<abc@???>" from smtp recipient rewritten
> as "abc@???"
> ===================
>
> This is okay, but is there any way to tie up the logged message with the
> Exim message id (i.e. something like 1VCtXO-0005Wt-M2)?
`log_selector = +address_rewrite +pid`
Use the pid, correlate with the subsequent id assignment. Look at
exigrep for inspiration on correlation in Perl.
There will be corner cases around messages which end up rejected and
making sure you detect that and free up the tracking memory for each
transaction, and making sure you correctly handle multiple messages down
one SMTP connection, but the messages for _each_ pid will be linear, for
that pid, so as long as you separate out by pid you can match up
rewrites to messages.