OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Secondary mailserver and body_checks

From: Wietse Venema (wietseporcupine.org)
Date: Fri Jan 02 2004 - 15:18:28 CST


Helmut P. Fleischhauer:
> Hello,
>
> my mail server with pretty restrictive body_checks is also secondary
> mailserver for another server
> with quite a bunch of domains ( checks are less restrictive there )
> To test I stopped postfix on the primary server and saw incoming (
> supposed to be queued only ) messages
> running through the body checks.
> How do I setup body_checks that only mail for local domains is checked
> and mail remains untouched for domains where machine
> is secondary ?
> By the way, think it took me much longer to understand and get sendmail
> under control 6 or so years back

This is tricky, because the SMTP server does not implement the
header/body content filter.

With Postfix snapshots: set up one SMTP listener for yourself that
leaves content checks enabled, and one for MX backup that disables
header/body content checks.

/etc/postfix/master.cf:
    # Normal service with content filtering
    127.0.0.1:smtp ... ... ... ... ... smtpd
    1.2.3.4:smtp ... ... ... ... ... smtpd

    # Backup service without content filtering
    1.2.3.5:smtp ... ... ... ... ... smtpd
        -o receive_override_options=no_header_body_checks

Not very elegant, but does the job.

        Wietse