On 05/22/2011 03:46 AM, Diego Woitasen wrote:
Hi,
I'm writing a report system and I want to identify the messages
moving through my mail servers. I need this because I must save some
headers and the first lines of the message in a database with the
information from the log files.
I think that the best way to relate the messages with the log lines
is using the message-id but it has a problem. I can't trust in
messages that arrive from the world. So what a want to do is to
replace the message-id when every message arrives to our MXs and copy
the original message-id to a second header. Message-id sometimes are
useful to debug issues and I don't want to loose that information.
Suggestions about how to do this?
Read http://www.postfix.org/header_checks.5.html on how to manipulate
headers.
The more complex case of dual actions you want may be better solved
using milters, though:
http://www.postfix.org/MILTER_README.html
Can you explain why you need log information ?
If you don't, simply piping all mail through an external processor will
be the simplest way to extract information from it.
This can be achieved in various ways, using recipient_bcc_maps or an
smtp proxy.
Regards,
Diego
--
Diego Woitasen
--
J.