[Mimedefang] Best place to collect Sender, Recipient and Server IP on a single log line

Paul Murphy pjm at ousekjarr.org
Sat Mar 15 16:37:04 EDT 2014


Jon,

Filter_sender is called after the MAIL FROM stage of the SMTP dialog, so
the recipients are unknown at this time.

Filter_recipient is called once per envelope recipient (RCPT TO in the
SMTP dialog).  You can write the (sender, recipient, RelayAddr) tuple
out from here using md_syslog, which for a message sent to 8 recipients
at your host will give you 8 lines of output.

Filter_end is called when the message has been processed, so you will
have an array of @Recipients which lists all of the envelope recipients
seen for the message.  You can write this out using join(@Recipients),
as (sender, RelayAddr, recip1, recip2, recip3...)

Don't assume that you will have only one recipient per message - there
could be many at your host, unless you have used stream_by_recipient to
ensure that there is only ever one recipient per message processed by
the filter.

Best Wishes,

Paul.





More information about the MIMEDefang mailing list