postfix 跳过对授权 SMTP 的垃圾邮件检查

6 postfix spam spamassassin amavis

有什么方法可以配置 postfix 以跳过对 SMTP 认证的 smtp 连接的垃圾邮件/防病毒检查?我想保留对外部 smtp 流量的所有标准检查,但对于发送电子邮件的本地用户,我想跳过反垃圾邮件/防病毒检查。

我的配置在几乎标准配置中有 Postfix + Amavisd + SpamAssassin + clamav。

提前致谢。先生

Bal*_*sár 1

在main.cf中,设置

smtpd_data_restrictions = reject_unauth_pipelining,permit_sasl_authenticated,check_sender_access pcre:/etc/postfix/content_filter.pcre
Run Code Online (Sandbox Code Playgroud)

不要在 main.cf 中设置 content_filter=!

/etc/postfix/content_filter.pcre 应该是这样的:

/^/ FILTER smtp-amavis:[127.0.0.1]:10024
Run Code Online (Sandbox Code Playgroud)

别忘了奔跑

postmap /etc/postfix/content_filter.pcre
Run Code Online (Sandbox Code Playgroud)

master.cf 应该是这样的:

127.0.0.1:10025 inet n  -   n -   -  smtpd
    -o content_filter=
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_data_restrictions=
    -o smtpd_restriction_classes=
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks=127.0.0.0/8
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
smtp-amavis unix -      -       n       -       16       lmtp
    -o lmtp_data_done_timeout=1200
    -o lmtp_send_vforward_command=yes
    -o disable_dns_lookups=yes
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助。请参阅http://www.postfix.org/postconf.5.html了解更多信息。