On Nov 30, 2008, at 4:13 PM, mouss wrote:
Dan Langille a écrit :
Following one from John's success, I'm failing. One difference
between
John's setup and mine is my header_checks directive. It was
defined in
master.cf:
-o header_checks=pcre:/usr/local/etc/postfix/obscure_smtp_auth
did you add that to an smtpd service? see below.
I know I'm putting this directive into the direct Postfix daemon
becuase
the remove of the following directive, from within the same
declaration,
affects the email headers:
-o smtpd_sasl_authenticated_header=yes
I had to move this header_checks directive into main.cf to get the
REPLACE working.
you can do it in master.cf:
submission ... smtpd
-o smtpd_sasl_authenticated_header=yes
-o cleanup_service_name=cleanmsa
...
cleanmsa .... cleanup
-o header_checks=pcre:/usr/local/etc/postfix/obscure_smtp_auth
I tried it like this:
10.0.0.1:smtps inet n - n - - smtpd
-o smtpd_sasl_auth_enable=yes
-o
smtpd_recipient_restrictions
=permit_sasl_authenticated,reject_unauth_desti
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
-o smtpd_sasl_authenticated_header=yes
-o smtpd_tls_security_level=encrypt
-o header_checks=pcre:/usr/local/etc/postfix/obscure_smtp_auth
-o smtpd_tls_wrappermode=yes
-o smtpd_tls_cert_file=/usr/local/etc/CERTS/nyi.example.org
-o smtpd_tls_key_file=/usr/local/etc/CERTS/nyi.example.org.
-o smtpd_client_restrictions=$smtps_client_restrictions
-o smtpd_helo_restrictions=$smtps_helo_restrictions
-o smtpd_sender_restrictions=$smtps_sender_restrictions
The expression I'm using does the following:
- replaces the authenticated user
- replaces the host/ip address of the origin host
- retains the original spacing/newlines
/^Received: from (.* \([-._[:alnum:]]+
\[[.[:digit:]]{7,15}\]\))(.*)\(Authenticated sender: ([^)]+)\)(.*)(by
nyi\.unixathome\.org) \(([^)]+)\) with (E?SMTPS?A?) id
([A-F[:digit:]]+)(.*)/ REPLACE Received: from smtp-
auth.unixathome.org
(smtp-auth.unixathome.org [10.4.7.7])$2(Authenticated sender:
hidden)$4$5 ($6) with $7 id $8 $9
--
Dan Langille
http://langille.org/