Le 15/09/2011 23:07, Michael C. Robinson a écrit :
> I've looked at emails I've been setting aside and have noticed that
> there are 5 received from lines that my servers post.  The one I
> probably want is posted first when the external SMTP server contacts my
> relay.  After that, my server passes the message to amavis which
> produces two Received from lines. 

unless you're passing mail to amavisd-new twice, it should only generate
one received line.

you can disable this line in amavisd.conf:

$allowed_added_header_fields{lc('Received')} = 0;


if you also want to remove the Received line added by postfix when it
receives mail from amavisd, then use header_checks with IGNORE. to make
things easier, set $myhostname in amavisd.conf to something you can
easily catch. but don't rely solely on this. use regular expressions
that match the line you want to disable while not matching lines
generated by by other MTAs. (and while testing, use REPLACE instead of
IGNORE).

> At this point, the message is passed
> to my postfix mailhub.  Finally, the fifth Received from relates to the
> hub delivering the message.  So I am assuming that I want the first of
> these five received from lines and I am assuming that I don't care about
> the rest of the received from lines considering that they might be
> faked.
> 
> I am attaching my perl script that is responsible for extracting the
> correct received from line from an mbox file.  Comments on how to
> improve this script are welcome.

Reply via email to