I have a Postfix server that has to receive messages with special X- headers that I use to update a database before sending the message on. I store the message ID, current timestamp and details taken from the X- headers for later processing. Later I scan the logs so that I can update the database with disposal information such as sent, bounced or expired.

To do this I created a content filter that I put into master.conf. This filter does the above processing and then re-injects the message back into Postfix as described in the Postfix documentation. Everything works pretty well. The one issue I have is that scanning the logs shows two Postfix IDs for each message ID, once for the original queue and once for the re-injection. I only care about the second one and I suppose that I can just ignore the first but that seems kludgy since they could theoretically show up in different logs.

Ideally I want my filter to run on the message without removing it from the queue. That way every message has one and only one Postfix ID. I can deal with the fact that IDs can be reused but I can handle that because as far as I can tell they won't be reused during the time that the message is in the queue. By the time that it is reused the message will be sent, bounced or expired and I won't be processing it any more. I am not treating the Postfix ID as a unique key, only the message ID.

So, my question, which I am afraid I already know the answer to, is can I examine the content of each message without interfering with the regular processing of the message. I know that I can set up two Postfix servers but that just seems even more kludgy than what I have.

Thanks for any ideas.

--
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:da...@vex.net
VoIP: sip:da...@vex.net

Reply via email to