An alternative way of handling spam
I came across a very useful feature in Postfix that I’ve somehow completely missed – the ability to make virtual ‘wildcard’ email addresses, and it has really changed how I handle spam.
A lot of websites require a login, and most of them need your email address to create a profile. I’ve never been fond of submitting my personal email address on all these sites, and my experience is that most websites either sell or lose your address to spammers. I’ve even seen spam sent to addresses I’ve registered on websites of danish newspapers and other sites I’d usually trust.
Instead of using my personal email address I created a new account on my mailserver called spam@domain.com and even though I’ve only used it to create profiles on various semi-serious websites it became flooded with spam within a short amount of time. It didn’t matter much as it was a secondary address but I wanted to somehow track which websites that was giving away my email address. This is where regexp shines. With only one line added to my Postfix configuration I can now track at what sites my email address is “lost” to spammers:
In main.cf I add
virtual_maps = regexp:/etc/postfix/virtual-regexp
Create the file /etc/postfix/virtual-regexp and add this line:
/^login_(.+)@domain.com$/ spam@domain.com
(Remember to do a postmap /etc/postfix/virtual-regexp when making changes to this file)
With this simple change in my configuration I now have a ‘wildcard’ email address called login_*@domain.com.
Why? Let’s say I visit Sony’s site playstation.com and I for some reason fear they’ll lose my account details to hackers. I create my account with login_playstation.com@domain.com and since the address is just a reg-ex alias I will still get the mails in my old spam mailbox. I don’t have to create a new email alias or anything on my mailserver, the regexp will make sure that addresses starting with login_ always exist. And if Sony some day should be victim of hackers that give my address to spammers I can easily block mails that are sent to this address. This way I can still keep my good old mailbox that I use for all other kinds of email, and still get rid of the spam.
And on top of that I can easily track which sites that sell or lose my address.

Today I came across an old “feature” in Apache. A disk was running full on one of our Linux servers and to free up some space I deleted a 9 gigabyte logfile, but even though the file was gone the space left was the same on the disk. I’ve run into this before but I couldn’t remember how to fix it (which is why I’m writing this), but after a bit of searching I found a solution.
I’ve never understood why telnet is so rare a tool that it need to be installed in Windows. It’s not like it takes up vast amounts of space and it has been an universal tool for administrators for centuries.
Ever wondered how you set up authentication on your website using Apache 2 and an LDAP user database? Probably not, but in case you do this is what you need to know.
I’ve been fiddling a bit with the Google API for a small PHP project where I needed to pull GMail contacts. There is many ways to do this, but I’ll post the method I found easiest to use.
Most free antivirus software is as efficient as the ones you can buy, and out of the many I’ve tried Avast! is the best one. It’s stable, checks for updates quite often (every 4 hours) and has caught every single malicious piece of code I’ve come by through the last five years.