postfix: how do I set virtual mailbox to create null client? [closed]
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
myserver.com
www postfix # cat vmaps
[email protected] myserver.com/admin/
[email protected] myserver.com/admin/
[email protected] myserver.com/admin/
[email protected] myserver.com/admin/
[email protected] myserver.com/admin/
[email protected] myserver.com/admin/
I want to create another mailbox, to [email protected]
, 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
[email protected] myserver.com/../../dev/null
but to no avail.
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 [email protected] to the local user
virtual_alias_maps = hash:/etc/postfix/virtual_alias
/etc/postfix/virtual_alias
[email protected] no-reply
Create all necessary maps
# postmap /etc/postfix/virtual_alias
# postmap /etc/aliases
And don't forget restart the postfix