Hi, Thanks all for your reply. I mistyped "/^to:/" (actually it was Subject only) because I was testing with ways to display "from" and "to" (my original intent) in logs and WARN was not getting executed when email had no Subject.
Regarding the argument that they all come from different parts of postfix, I'm already getting all these in one line if I use appropriate regex in check_headers. I was just hoping if I could remove the noise. So, the best way to display "from", "to" and "queueid" in the same line is, I guess using "/^to:/" in check_headers. Because there won't be a message which won't contain "to" header. But, I'm not comfortable with doing that because then I'll have duplicate information in one line. ("to" header's value will come two times) On Tue, Apr 23, 2013 at 9:10 PM, /dev/rob0 <r...@gmx.co.uk> wrote: > On Tue, Apr 23, 2013 at 08:10:19PM +0530, Abhijeet Rastogi wrote: >> How flexible is postfix-2.8.7 to add one more log line in logs. >> >> My requirement is to have a line which will contain "queueid", >> "form", "to" & "subject" header in the same log line. >> >> If I add in header_checks a line like: >> >> /^to:/ WARN >> >> I get what I want but it also adds other stuff like "proto", > > How does that line get you the Subject: header? It does not. You > might use this: > > /^Subject:/ WARN > > And that would show everything you listed above, albeit not the > To/From headers: this would show the envelope sender and one of > [possibly numerous] envelope recipients. If the desire is to log > message content (that is, multiple headers), note from this link, > Postfix cannot do this natively: > > http://www.postfix.org/BUILTIN_FILTER_README.html#limitations > >> "helo" etc which I don't want. I want logs to be as clean as >> possible. Is there a way I can accomplish this? > > What information is logged is not configurable. Write a script to > clean up the logs before you look at them. :) > -- > http://rob0.nodns4.us/ -- system administration and consulting > Offlist GMX mail is seen only if "/dev/rob0" is in the Subject: -- Regards, Abhijeet Rastogi (shadyabhi) http://blog.abhijeetr.com