问题原文
原帖链接 · maxmitch · CC BY-SA 3.0
I have the main.cf config:
header_checks = regexp:/etc/postfix/header_checks
And the /etc/postfix/header_checks:
/^Subject:.*viagra.*/i DISCARD
/^Subject:.*pills.*/i DISCARD
/^Subject:.*f\*ckbuddy.*/i DISCARD
/^Subject:.*f\*ckfriend.*/i DISCARD
/^Subject:.*f\@ck.*/i DISCARD
/^From:.*viagra.*/i DISCARD
Notice I have added the /i to make case insensitive. Not sure if it allows this?
I have tried sending emails from a hotmail to my server with pills in the subject but still no luck! Also is there a return to sender method instead of DISCARD?
社区高分解答
原帖链接 · Ryan H. · CC BY-SA 3.0
If postmap -q "<put test header here>" regexp:/etc/postfix/header_checks is correctly returning DISCARD (or the appropriate action for the match) but postfix is not actually performing said action, then there is probably a receive_override_options=no_header_body_checks somewhere in main.cf or master.cf that is turning off the header checks. In the master.cf file, it would be a -o option in one of the service configuration entries.
There are 4 options for receive_override_options:
- no_unknown_recipient_checks Do not try to reject unknown recipients (SMTP server only). This is typically specified AFTER an external content filter.
- no_address_mappings Disable canonical address mapping, virtual alias map expansion, address masquerading, and automatic BCC (blind carbon-copy) recipients. This is typically specified BEFORE an external content filter.
- no_header_body_checks Disable header/body_checks. This is typically specified AFTER an external content filter.
- no_milters Disable Milter (mail filter) applications. This is typically specified AFTER an external content filter.
The no_address_mappings options will typically be located in main.cf while the other options, in master.cf
The "-o receive_override_options" overrides main.cf settings to avoid duplicating work that was already done before the content filter. These options are complementary to the options that are specified in main.cf
Source: Postfix After-Queue Content Filter
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
