15.11.2010 14:59, Wietse Venema wrote: > Catalin Iacob: >> 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=.... >> >> 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. > > You MUST NOT manipulate the Postfix queue with other programs.
The question is not about manipulating the queue. The question is merely about logging and connecting various pieces in the log together. I, while used postfix alot in the past, now rarely perform new installs (it all just works :). Recently I moved our mail to a new server and redid all configuration again. And faced a very well-known (to me anyway) problem again: what's the easy way to see a message life-cycle in a mail system? While it is in postfix, it is all connected in the log using the same queueID, so grepping it will give you good picture. But once there's at least one external component, there's no such grouping anymore. Postfix itself, when doing certain operations, performs logging like this (from memory): date host postfix/local[123]: queueID: forwarded to f...@bar.com newID there you can see the newID on the same line as old queueID. When such forwarding is done by an external agent, we'll see two lines like this: date host forwarder[124]: msgid=<baz-ms...@bar.com> forwarded to <f...@bar.com> date host postfix/local[123]: queueID: b...@bar.com delivered to program (/some/where/forwarder) Not they only backwards (understandable), but they also aren't conected in a way which is easy to find. Sure, there should be no messing with postfix queue. But there should be a way to export queueID attribute when running external programs so that all delivery steps are easily greppable in the log. And this question is about the latter, not the former. /mjt