Abhijeet Rastogi: > I missed one thing. I can't even use "to:" as it's not a required > header. So, I thought of using "Received;" header. That'll work most > of the times but then there is another issue now. > > Doc says that: > > Each message header or message body line is compared > against a list of patterns. When a match is found the > corresponding action is executed, and the matching process > is repeated for the next message header or message body > line. > > So, if I add this regex at the top, there will be a case where further > header checks will be missed. If I add it at the bottom, there is a > possibility that it'll never be matched. > > So, what exactly is the solution now? My sole requirement is getting > "queueid", "from" and "to" in the same log line. Getting other headers > is just a secondary thing.
The docs also say that header_checks are not a content management tool. Their purpose is to stop a burst of virus/worm/backscatter mail with easy-to-recognize signatures. If you need access to random message content, look for a Milter, or for an SMTP-based A/V filter that can log such information for you. Wietse