[BlueOnyx:08875] Re: forward email to /dev/null?

Michael Stauber mstauber at blueonyx.it
Thu Oct 20 10:51:59 -05 2011


Hi Roy,

> How can we setup those mailboxes to dump any inbound email so we aren’t
> cleaning out the mailbox periodically due to rejections, etc.?

Edit /etc/mail/virtusertable and find all aliasses related to that mailbox.

An example could look like this:

mstauber at 5107rmail.smd.net      mstauber

You could handle the situation in two possible ways by changing the username 
part:

Method a):
mstauber at 5107rmail.smd.net      nobody

Method b):
mstauber at 5107rmail.smd.net      error:nouser No such user here

Changing the username to "nobody" will accept the emails to the email address 
in question. But in /etc/mail/aliasses "nobody" is mapped to /dev/null. So the 
email will then be silently discarded.

Changing the username to "error:nouser No such user here"  will instead refuse 
to accept the email and the sender gets an error message, telling him "No such 
user here". You could change the "No such user here" to something else, but it 
should be a really, really brief description without much in the way of using 
any non-alphabetical characters.

Once you have edited /etc/mail/virtusertable run these two commands:

makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable
/etc/init.d/sendmail restart

But be prepared that these changes are not permanent. If you use the GUI to 
update these VSites email settings, or if you use the GUI to edit this users 
email details, then these changes will get reverted back to what they were 
before.

-- 
With best regards

Michael Stauber




More information about the Blueonyx mailing list