| This piece of code is intended for those people that are using qmail, and which have set up a .qmail-default to have all email (other) addresses of a domain wind up in the same mailbox.
This behaviour has become very annoying when spammers just get a valid domain name and just start prefixing names they found somewhere else. You will then always get these in your mailbox. And because they don't bounce, some spammers will use that knowledge to conclude it's a valid email address and start using it again.
Of course, blacklisting these email addresses is pretty straightforward in qmail: just add the appropriate .qmail-.... file. But of course, we're lazy, so I devised a lazier way to do this.
Instead of having to login to a shell and go to the right directory and start creating the file, the only thing you need to do is do a "send again" of an offending email. You will receive that email then once more, but never again will you receive email on that address.
Theory of operation: add the line:
as the first line to your .qmail-default file. Keep the rest of the lines in there. Whenever a mail is received with "email@example.com" as the sender of the email, then it will put the addressee on the blacklist (by creating a .qmail-addressee and .qmail-addressee-default file that drops the email).
Lifting the blacklist is as easy as removing the appropriate .qmail-addressee files.
Put this code in a file named "blacklist" and make sure it is executable with your uid. You can name it anything you want and put it anywhere you want, as long as you adapt the first line in the .qmail-default file accordingly.
Thanks to batkins for unknowingly inspiring me to do this.