views:

700

answers:

3

I would like to trash the mail received by a single qmail alias. I don't want any mail delivery errors, and I want qmail to be happy about having delivered the mail.

How can I do this, preferably without adding another local email account?

+1  A: 

Create an alias by creating a file /var/qmail/aliases/.qmail-blackhole with this content:

|cat >/dev/null

Then redirect whatever you want to this ‘blackhole’ alias (or use whatever you want in place of ‘blackhole’). Merely using /dev/null won’t work (Unable_to_write_/dev/null).

The messages will still be logged, however. Though it’s more of a feature than a bug.

Roman Odaisky
A: 

A meta-question: why would this get rated down? Is it not appropriate for the site?

pcorcoran
Strictly speaking the site is for programming related questions - however it seems to be a law unto itself right now (with regards to downvoting)...
Mark Ingram
+1  A: 

Create an alias with only a comment and no delivery instructions, like:

echo "# drop all messages on the floor" > ~alias/.qmail-devnull

Replace "devnull" with whatever alias name you need of course.

drench