pcorcoran
pcorcoran

Reputation: 8082

What is the best way to forward a single qmail alias to /dev/null?

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?

Upvotes: 1

Views: 2985

Answers (3)

drench
drench

Reputation: 231

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.

Upvotes: 1

pcorcoran
pcorcoran

Reputation: 8082

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

Upvotes: 0

Roman Odaisky
Roman Odaisky

Reputation: 2941

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.

Upvotes: 2

Related Questions