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! 🙂

One thought on “Regex spam prevention”

Leave a Reply

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