My postfix configuration allows mail via several local_recipient_maps. However, delivery to "proxy:unix:passwd.byname" is specifically disabled. This normally prevents delivery to local unix users:
$ getent passwd | grep www-data www-data:x:33:33:www-data:/var/www:/bin/sh $ nc localhost 25 220 my.mail.host ESMTP Postfix helo localhost 250 my.mail.host mail from:email@example.com 250 2.1.0 Ok rcpt to:firstname.lastname@example.org 550 5.1.1 <email@example.com>: Recipient address rejected: User unknown in local recipient table rcpt to:www-data 550 5.1.1 <www-data>: Recipient address rejected: User unknown in local recipient table
However this morning I noticed an email delivered to the local www-data mail spool file. Looking within, I see that:
- It was a message from firstname.lastname@example.org, sent by a different host within our network, using my.mail.host as the smarthost
- It remained within my.mail.host queue for several days while attempting retries
- It then bounced
- The bounce was delivered to a "www-data" mail spool file on my.mail.host
So my question is: why did this happen, and how do I prevent it from happening in the future?