![]() ![]() If you are sure an email address won’t be accepting emails with multiple recipients in the To: header, you can add the following lines to discard such email. Some stupid spammers use multiple email addresses in the To: header, instead of using Blind Carbon Copy (BCC). If an innocent user’s email address is used as the sender address, you can claim successful delivery, so that the innocent user does not receive bounce messages. DISCARD can also be useful to minimize the backscatter problem. I often use DISCARD when I don’t want the spammer to know I have blocked a certain phrase for incoming email. DISCARD makes it look as if the message was delivered even though it was simply thrown away. ![]() This will cause Postfix to claim successful delivery and silently discard the message. You can also use DISCARD, instead of REJECT. By default regular expression checking is not case-sensitive. If any of the strings on the left-hand appear in any of the headers of an email message (these would most likely show up in the Subject: header), the message is rejected during the SMTP dialog. The lefthand key is a regular expression enclosed by two forward slashes. You can add regular expression checking like below. Then you need to create the /etc/postfix/header_checks lookup file with a command line text editor such as Nano. header_checks = pcre:/etc/postfix/header_checks sudo nano /etc/postfix/main.cfĪdd the following line at the end of the file. To enable header_checks in Postfix, open the main configuration file. Run the following command and you will see pcre is now supported. To use PCRE in Postfix, you need to install the postfix-pcre package. Postfix comes with POSIX regular expression support, but PCRE is way faster. PCRE: Perl compatible regular expression.There are mainly two types of regular expressions that can be used by Postfix. Header and body checks are done by the Postfix cleanup daemon. If Postfix finds a match, the specified action is executed. The patterns are compared to strings within email messages (header and body). Each parameter points to a lookup table containing regular expression patterns and actions. Postfix will check all inbound emails when any of the above parameters is being used. Postfix provides 4 simple content checking parameters. Email Header and Body Checks with Postfix SMTP Server SpamAssassin is a free, open-source, flexible and powerful spam-fighting tool. Specifically, we will see how to check email header and body with Postfix and SpamAssassin (SA) to detect spam. I’m going to share more tips and tricks to block email spam in this article. In previous articles, we discussed how you can quickly set up your own mail server using iRedMail and 7 effective methods for blocking email spam with Postfix SMTP server. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |