Regex spam prevention

I have been receiving large volumes of spam to random, numerical addresses at my domain. For example 48321819.1928382@, and so on. It’s not practical to block a single address. The spammers make up new addresses at random.

I wanted to block addresses using wildcards. For example, anything that starts with a 4 and ends with @domain.com. I use postfix, so I did some research. I didn’t find much, so I asked on the #postfix FreeNode channel. The very helpful sysmonk introduced me to regex tables in postfix.

So, I have now managed to block a whole bunch of addresses using a few simple regex patterns. The amount of spam I receive has dropped by almost 90% already. Yay! :)

This entry was posted in Techy and tagged , , , . Bookmark the permalink.

One Response to Regex spam prevention

  1. Diederik says:

    Callum,

    I find it very odd to hear that you have loads of spam. Personally, I use the ZEN blacklist (http://www.spamhaus.org/zen/), together with SpamAssassin, and Greylisting (http://postgrey.schweikert.ch/)

    Especially the latter is a project you should have a look at!

    Cheers!
    Diederik

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>