|
/Admin/email/postfix:
Filtering E-mail Content
This is remarkably simple in Postfix.
Create two files, /etc/postfix/header_checks and /etc/postfix/body_checks, with content like the following:
/Anatrim/ REJECTThen add the following lines to /etc/postfix/main.cf:
/Viagra/ REJECT
body_checks = regexp:/etc/postfix/body_checksand as usual restart postfix:
header_checks = regexp:/etc/postfix/header_checks
/etc/init.d/postfix restart
"header_checks" will reject any e-mail which contains any of the specified strings in the header, and "body_checks" will reject any e-mail which contains any of the specified strings in the body. Note that the header of an e-mail is generally much smaller then the body, so there is much less overhead with header checking. Also, these checks are case insensitive.
There is the added bonus that the offending e-mails will be rejected by your e-mail server in a way that might very well leave a spammer with the impression that they are sending to an invalid e-mail address.
An excellent resource: http://www.securityfocus.com/infocus/1598
posted at: 08:10 | path: /Admin/email/postfix | permanent link to this entry