master.cf:
## outgoing smtp server
192.168.1.99:250 inet n - n - 30 smtpd
-o disable_dns_lookups=yes
-o content_filter=
-o header_checks=pcre:/etc/postfix/header_outgoing
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_data_restrictions=
-o
smtpd_recipient_restrictions=reject_non_fqdn_sender,reject_non_fqdn_recipient,permit_mynetworks,reject
header_outgoing:
/^Received:/ IGNORE
/\s*by/ IGNORE
/\s*for </ IGNORE
I turn on debug on main.cf but it says nothing about header_checks.
[root@blowfish postfix]# postconf -m |grep pcre
pcre
--
--beast
In main.cf i already had different rule for incoming.
header_checks = pcre:/etc/postfix/header_incoming
--
--beast
> In main.cf i already had different rule for incoming.
>
> header_checks = pcre:/etc/postfix/header_incoming
You cannot define different sets of header|body_checks within a single
instance. I will repeat, main.cf, not master.cf. Listen to an answer. If
you already knew the answer, you would not ask the question.
Matt
> You cannot define different sets of header|body_checks within a single
> instance. I will repeat, main.cf, not master.cf. Listen to an answer. If
> you already knew the answer, you would not ask the question.
It's possible to have different header_checks etc within a single Postfix
instance, but you must in that case define multiple cleanup services and
select among them with cleanup_service_name.
--
Magnus Bäck
mag...@dsek.lth.se
> > You cannot define different sets of header|body_checks within a
> > single instance. I will repeat, main.cf, not master.cf. Listen to an
> > answer. If you already knew the answer, you would not ask the
> > question.
>
> It's possible to have different header_checks etc within a single
> Postfix instance, but you must in that case define multiple cleanup
> services and select among them with cleanup_service_name.
Oops :)
Matt
> > It's possible to have different header_checks etc within a single
> > Postfix instance, but you must in that case define multiple cleanup
> > services and select among them with cleanup_service_name.
That would also require setting up separate smtpd listeners for each
cleanup_service_name as well, would it not?
Matt
>
> I have create separate instance of smtpd for outgoing mail only.
> I want to remove any "Received:" header written by my internal mail
> server.
>
> master.cf:
> ## outgoing smtp server
> 192.168.1.99:250 inet n - n - 30 smtpd
> -o disable_dns_lookups=yes
> -o content_filter=
> -o header_checks=pcre:/etc/postfix/header_outgoing
> -o smtpd_restriction_classes=
> -o smtpd_client_restrictions=
> -o smtpd_helo_restrictions=
> -o smtpd_sender_restrictions=
> -o smtpd_data_restrictions=
> -o
> smtpd_recipient_restrictions=reject_non_fqdn_sender,reject_non_fqdn_recipient,permit_mynetworks,reject
>
>
> header_outgoing:
> /^Received:/ IGNORE
> /\s*by/ IGNORE
> /\s*for </ IGNORE
Do you really want to remove
To: john.ford <j...@example.com>
To: <be...@example.com>, bylaw <by...@example.net>, <co...@show.example>
Subject: my connection is rejected by your firewall
and so on...
The /^Received:/ rule is enough. header_checks parse a "logical header".
PS. Note that
/\s*xzy/ matches the same things as /xyz/
/\s+xyz/ matches the same things as /\sxyz/
the \s is only useful if you have other things to match, such as in
/Received:\s*from/.
> Beast wrote:
>
>>
>> I have create separate instance of smtpd for outgoing mail only.
>> I want to remove any "Received:" header written by my internal mail
>> server.
>>
>> master.cf:
>> ## outgoing smtp server
>> 192.168.1.99:250 inet n - n - 30 smtpd
>> -o disable_dns_lookups=yes
>> -o content_filter=
>> -o header_checks=pcre:/etc/postfix/header_outgoing
>> -o smtpd_restriction_classes=
>> -o smtpd_client_restrictions=
>> -o smtpd_helo_restrictions=
>> -o smtpd_sender_restrictions=
>> -o smtpd_data_restrictions=
>> -o
>> smtpd_recipient_restrictions=reject_non_fqdn_sender,reject_non_fqdn_recipient,permit_mynetworks,reject
>>
>>
>> header_outgoing:
>> /^Received:/ IGNORE
>> /\s*by/ IGNORE
>> /\s*for </ IGNORE
>
>
>
> Do you really want to remove
> To: john.ford <j...@example.com>
oops. this one won't match. but
To: for <friends.o...@nowhere.example>
would.
Indeed it would.
--
Magnus Bäck
mag...@dsek.lth.se