I have a setup postfix/dovecot/mysql on Centos 6.5 following the guide at DigitalOcean.
I have virtual addresses and aliases working just fine, and now I am trying to add a donotreply alias.
In my virtual users table I have an entry for donotreply@mydomain.com
with a destination of devnull
.
At the end of /etc/aliases
I have
devnull: /dev/null
I ran newaliases
after this.
Checking the virtual alias :
$ postmap -q donotreply@mydomain.com mysql:/etc/postfix/mysql-virtual-alias-maps.cf
devnull
When I send mail to this address I get a 'user doesn't exist' bounce for devnull@mydomain.com
Mar 25 14:48:12 vps1 postfix/lmtp[7686]: 8543360392: to=<devnull@mydomain.com>, orig_to=<donotreply@mydomain.com>, relay=host.mydomain.com[private/dovecot-lmtp], delay=0.14, delays=0.07/0.01/0.01/0.05, dsn=5.1.1, status=bounced (host host.mydomain.com[private/dovecot-lmtp] said: 550 5.1.1 <devnull@mydomain.com> User doesn't exist: devnull@mydomain.com (in reply to RCPT TO command))
Postfix (and dovecot) have been reloaded after every change, and still no luck.
My postfix conf :
$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
milter_default_action = accept
milter_protocol = 2
mydestination = localhost
myhostname = host.mydomain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_milters = inet:127.0.0.1:8891
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /path/to/ssl/cert
smtpd_tls_key_file = /path/to/ssl/privatekey
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
I also tried enabling local recipient maps in /etc/postfix/main.cf
local_recipient_maps = unix:passwd.byname $alias_maps
but that didn't work either.
I also created a devnull local user
$ useradd -M -d /dev/null -s /sbin/nologin devnull
but that also changed nothing.
How do I get a virtual alias to redirect to /dev/null?