I have a simple mail server, using vhost/vmaps to create virtual mailboxes.

here is my current setting:

www logs # postfix | grep virtual
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = /etc/postfix/vhosts
virtual_mailbox_limit = 51200000
virtual_mailbox_lock = fcntl, dotlock
virtual_mailbox_maps = hash:/etc/postfix/vmaps

www logs # cd /etc/postfix
www postfix # ls
dynamicmaps.cf  post-install    recipient_bcc     vhosts
main.cf         postfix-files   recipient_bcc.db  vmaps
master.cf       postfix-script  sasl              vmaps.db
www postfix # cat vhosts
www postfix # cat vmaps
root@myserver.com myserver.com/admin/
postmaster@myserver.com myserver.com/admin/
fmaster@myserver.com myserver.com/admin/
abuse@myserver.com myserver.com/admin/
survey@myserver.com myserver.com/admin/
admin@myserver.com myserver.com/admin/

I want to create another mailbox, to no-reply@myserver.com, that every mail sent to this account gets thrown to /dev/null automatically.

How should I edit my main.cf/virtual domains/virtual maps?

I tried

no-reply@myserver.com myserver.com/../../dev/null

but to no avail.

closed as off-topic by Jenny D, mdpc, MadHatter, Katherine Villyard, Sven Dec 8 '14 at 20:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Jenny D, mdpc, MadHatter, Katherine Villyard, Sven
If this question can be reworded to fit the rules in the help center, please edit the question.


Try the following

Create local user

# useradd -s /sbin/nologin -d /dev/null no-reply
# passwd no-reply

Add the following line to the /etc/aliases

no-reply: /dev/null

Point no-reply@myserver.com to the local user

virtual_alias_maps = hash:/etc/postfix/virtual_alias


no-reply@myserver.com no-reply

Create all necessary maps

# postmap /etc/postfix/virtual_alias
# postmap /etc/aliases

And don't forget restart the postfix

  • In my case it was necessary to use no-reply@localhost in the virtual alias table to use the local transport – sebix Apr 7 at 9:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.