Postfix PCRE TLD body check

This is used to reject spam e-mail containing a URL to the top level domains .date or .loan, and can of course be modified to include others. If you feel your users may ever have a legitimate need to be contacted about these domains it would be best to not use this.

Some familiarity with perl compatible regular expressions in postfix will be helpful.

/https?:\/\/([a-z,0-9,-]+\.){1,3}(date|loan)\// REJECT

This pattern matches both http and https protocols, and links containing from 1 to 3 subdomains of the TLD (http://3.2.example.com/ or https://example.com/ would match were .com the target).

Insert that line into your custom body checks file and no more spam du jour. Enjoy.

Leave a Reply

Your email address will not be published. Required fields are marked *