Sébastien,

> The original mail is from stat@xxx to nbenhadid@xxx, mduriez@xxx and
> dgueraud@xxx.
> 
> When postfix transmit it to amavis we have those lines
> postfix/smtp[4439]: C7A527414E: to=<mduriez@xxx>,
> relay=127.0.0.1[127.0.0.1]:10050, delay=8.8, delays=6.1/0/0/2.7,
> dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04231-04, from
> MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1433874162)
> postfix/smtp[4439]: C7A527414E: to=<dgueraud@xxx>,
> relay=127.0.0.1[127.0.0.1]:10050, delay=8.8, delays=6.1/0/0/2.7,
> dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04231-04, from
> MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1433874162)
> postfix/smtp[4439]: C7A527414E: to=<nbenhadid@xxx>,
> relay=127.0.0.1[127.0.0.1]:10050, delay=8.8, delays=6.1/0/0/2.7,
> dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04231-04, from
> MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1433874162)
> postfix/qmgr[364]: C7A527414E: removed
> 
> So postfix queued three mails whith the same id 1433874162.
> 
> Now when amavis looks at these mails :
> 
> amavis[4231]: (04231-04) Passed CLEAN, SCAN-OUTMAIL [YY.YYY.YYY.YY]
> YY.YYY.YYY.YY] <stats@xxx> ->
> <mduriez@xxx>,<dgueraud@xxx>,<nbenhadid@xxx>, Message-ID:
> <011b01cbd821$4075e660$c161b320$@fr>, mail_id: yzSTUfSdJ2wI, Hits: -1,
> size: 265980, queued_as: 1433874162/4867674151, 2716 ms
> 
> Amavis give them two different queue ids 1433874162 and 4867674151.
> 
> So when looking for mail 4867674151 we can't get back to the original
> queue id C7A527414E.
> [...]
> 
> But we really need to be able to get back from the id after amavis to
> the id before because we want to trace whole mail process from entering
> to postfix, pass through amavisd and postfix reinjection.
> What's the solution please ?

If you need correct per-recipient responses, the solution is
to use LMTP instead of SMTP to feed mail from Postfix to amavisd.

On the amavisd side there are no changes required. On the Postfix
side change the 'amavisfeed' entry (or whatever you call it in
a content_filter setting), replacing 'smtp' with 'lmtp' throughout,
e.g. in a service program name, as well as in all its options.


Btw, starting with amavisd-new-2.7.0-pre13 and Postfix 2.8.0,
it became even more comfortable to associate a Postfix queue ID
on each side of a content filter

RELEASE_NOTES:

- added a client-side and server-side support for the IDENT attribute of
  a Postfix XFORWARD smtp command (available since Postfix version 2.8.0).
  The attribute allows passing of a local message identifier (MTA queue id)
  downstream from a front-end MTA to a post-queue content filter and back
  to a back-end MTA. Amavisd makes this information available through an
  existing macro %Q (which was previously non-empty only in milter setups),
  and as such the information appears in the log when using a default amavisd
  log template. This information is also passed back to a re-entry MTA if
  it announces a support for this attribute (enabled on a back-end smtpd
  service with an option smtpd_authorized_xforward_hosts), so the log entries
  are now easier to correlate:

  back-end MTA:
    postfix/smtpd[72995]: 553261D1CB0: client=localhost[::1],
      orig_queue_id=2F5971D1CA3, orig_client=...

  post-queue content filter:
    amavis[20341]: (20341-15) Passed CLEAN ...
      Queue-ID: 2F5971D1CA3, queued_as: 553261D1CB0

  front-end MTA:
    postfix/lmtp[73130]: 2F5971D1CA3: ... relay=127.0.0.1[127.0.0.1]:10024,
      status=sent (250 2.0.0 from MTA(smtp:[::1]:10025):
                   250 2.0.0 Ok: queued as 553261D1CB0)


Mark

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 Please visit http://www.ijs.si/software/amavisd/ regularly
 For administrativa requests please send email to rainer at openantivirus dot 
org

Reply via email to