On 06/21/2014 06:00 PM, Wietse Venema wrote: > Each recipient can be reported with the Milter RCPT event handler. > This combined with the queue ID, allows the Milter to maintain a > counter that can be queried at End-Of-Message time. > > The Milter can also be notified of "abort" events. This allows it > to can discard a counter when its mail transaction is aborted.
Thank you, I would like to avoid Milter and take advantage of the current solution with smtpd policy. > The same is possible with SMTPD policy daemons. Each Postfix SMTP > daemon maintains a persistent connection to a policy daemon, and > when the queue ID in the requests over that connection changes, or > when that connection is closed, the counter can be discarded. I was thinking about logging recipient info in the RCPT phase and match it later in the EOM phase, but queue ID attribute seems a bad election because for multiple recipient mails queue ID is empty in the first smtpd recipient, at least with postfix 2.7.1. you can see: (full trace: http://marc.info/?l=postfix-users&m=140308426901438 ) postfwd2/policy[13164]: [POLICY_DATA] protocol_state=RCPT postfwd2/policy[13164]: [POLICY_DATA] queue_id= [...] postfwd2/policy[13164]: [POLICY_DATA] protocol_state=RCPT postfwd2/policy[13164]: [POLICY_DATA] queue_id=6FE61A057 [...] postfwd2/policy[13164]: [POLICY_DATA] protocol_state=END-OF-MESSAGE postfwd2/policy[13164]: [POLICY_DATA] queue_id=6FE61A057 it is better use the instance attribute: postfwd2/policy[13164]: [POLICY_DATA] instance=3380.53a145f6.6927a.0 [...] postfwd2/policy[13164]: [POLICY_DATA] instance=3380.53a145f6.6927a.0 [...] postfwd2/policy[13164]: [POLICY_DATA] instance=3380.53a145f6.6927a.0 It would be nice to have an attribute with all recipients but I suppose it must be some downside. Have a nice day.