Noel Jones wrote:
Daniel L. Miller wrote:
Nate Carlson wrote:
On Thu, 5 Mar 2009, Wietse Venema wrote:
I've found tricks to remove or edit Received headers for specific
IP's via
'header_checks'; however, what I'd like to be able to do is either
remove
the header altogether or modify the IP to one of the IP's that we
own for
all authenticated users that submit mail via 465/587.
$ man header_checks | less +/IGNORE
$ man header_checks | less +/REPLACE
Thanks.. I've got that, but I'm not finding a way to only match mail
that comes in via Submission, and not via regular SMTP. Is there a
way to tell Postfix to only apply the header_checks to certain mail
processes?
I suppose I could do something like 'no_header_body_checks' on the
main SMTP process, but it'd be nice to be able to do some checks
there in the future too.
You can make the change in master.cf. Find the "submission" line, and
add the parameter. For example:
submission inet n - - - - smtpd
-o header_checks=hash:/etc/postfix/maps/submission_header_checks
You're on the right track, but your example won't work - header_checks
are a property of the cleanup process, not smtpd. And while it's legal
to use hash: maps for header_checks, it's not very useful.
The solution is to define an alternate cleanup service for "submission",
and then define alternate header_checks for that cleanup
submission ... smtpd
-o cleanup_service_name=cleanup_submission
cleanup_submission ... cleanup
-o header_checks=pcre:/path/to/header_checks
Oh, and recent postfix marks authenticated headers; note the
ESTMPSA. S = StartTLS, A = Authenticated
Received: from [192.168.5.108]
(adsl-19-247-14.bna.bellsouth.net [68.19.247.14])
by mgate2.vbhcs.org (Postfix) with ESMTPSA id BAF4A797A6A;
Thu, 5 Mar 2009 20:09:39 -0600 (CST)
a regexp something like
/^(Received: .* myhostname \(Postfix\) with ESTMPS?A .*)$/
REPLACE X-$1
should do the trick.
-- Noel Jones