On 11/15/2010 12:22 PM, Jeroen Geilman wrote:
On 11/15/2010 11:55 AM, Catalin Iacob wrote:
Hello everybody,

I use pipe to start my own script when an email to a certain address
is received. The script will do it's own logging and I want to be able
to correlate that logging with the Postifx logs. The queue id that is
used in the Postifix logs seems ideal for that. I think it's called
queue id in Postfix terminology, but to be clear, I'm referring to
21D5D497FE in the example below:
Nov 11 12:29:39 WCEA006 postfix/smtpd[28104]: 21D5D497FE: client=....

That is the Queue-ID, true.
However, since it's used internally by postfix, once a message is delivered it is no longer of use. It is not communicated to external commands.So my question is: is there any way I can have pipe pass the queue id
into my script? I couldn't find anything in the man page. If not, is
there another way in which I can make an easy correlation to the
Postifx logs? I use Postfix 2.7.0.
Postfix logs delivery to a pipe(8) command by sepcifically naming the service in master.cf that was used. This provides one part - you can screen the postfix log for that transport.

I would just log a (timestamp, sender, recipient, nexthop) tuple; this should provide enough specifics to correlate with the postfix logs.

You can also log that same tuple for each message (on a single line) by adding

    smtpd_client_restrictions = check_client_access static:WARN

Drat.

That should probably have been

smtp_recipient_restrictions = check_client_access static:WARN [, your other restrictions,...]

or it won't log all information - although that may depend on the setting of smtpd_delay-reject.


to your main.cf.

Of course, the extra log comes at a marginal price in performance - I don't know how much exactly but it can't be big.


Thank you,
Catalin Iacob




--
J.

Reply via email to