We run Postfix mail server. It's postfix + spamassasin + cyrus + MailScanner +MySQL. Primary mail server is used by one domain (example.com) (two domains in total). Postfix is using MySQL for virtual domains and users. Also I have rewrited one domain example.com
to example.biz
.
Server is set up (configured) about 7 years ago. Here is postconf -n
Problem is that in logfile I see some random recipients
to virtual domain. I read Postfix Backscatter Howto and this question. At this moment server is sending back Delivery Status Notification to that senders. I tried various configurations but without luck. Here is output from smtp log
postfix/smtpd[29764]: >>> CHECKING RECIPIENT MAPS <<<
postfix/smtpd[29764]: ctable_locate: leave existing entry key randomuser@example.com
postfix/smtpd[29764]: maps_find: recipient_canonical_maps: randomuser@example.com: not found
postfix/smtpd[29764]: match_string: example.com ~? mysql:/etc/postfix/mysql-mydestination.cf(0,lock|fold_fix)
postfix/smtpd[29764]: dict_mysql_get_active: attempting to connect to host unix:/var/run/mysqld/mysqld.sock
postfix/smtpd[29764]: dict_mysql: successful connection to host unix:/var/run/mysqld/mysqld.sock
postfix/smtpd[29764]: dict_mysql: successful query from host unix:/var/run/mysqld/mysqld.sock
postfix/smtpd[29764]: dict_mysql_lookup: retrieved 0 rows
postfix/smtpd[29764]: match_list_match: example.com: no match
postfix/smtpd[29764]: maps_find: recipient_canonical_maps: hash:/etc/postfix/myrecipientmap(0,lock|fold_fix): @example.com = @example.biz
postfix/smtpd[29764]: mail_addr_find: randomuser@example.com -> @example.biz
postfix/smtpd[29764]: smtpd_check_rewrite: trying: permit_inet_interfaces
postfix/smtpd[29764]: permit_inet_interfaces: mail-lf0-f51.google.com 209.85.215.51
postfix/smtpd[29764]: before input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapp
postfix/smtpd[29764]: after input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mappi
postfix/smtpd[29764]: connect to subsystem public/cleanup
postfix/smtpd[29764]: public/cleanup socket: wanted attribute: queue_id
postfix/smtpd[29764]: input attribute name: queue_id
postfix/smtpd[29764]: input attribute value: 6564E15F890
postfix/smtpd[29764]: public/cleanup socket: wanted attribute: (list terminator)
postfix/smtpd[29764]: input attribute name: (end)
postfix/smtpd[29764]: send attr flags = 50
postfix/smtpd[29764]: 6564E15F890: client=mail-lf0-f51.google.com[209.85.215.51]
postfix/smtpd[29764]: > mail-lf0-f51.google.com[209.85.215.51]: 250 2.1.5 Ok
postfix/smtpd[29764]: < mail-lf0-f51.google.com[209.85.215.51]: DATA
At log I see, that random user not found in database dict_mysql_lookup: retrieved 0 rows
. So, that's correct. But it isn't rejected at SMTP level. Obviously something is wrong with my config.
I tried adding virtual user lookup at smtpd_recipient_restrictions
directive and changed permit
to reject
but without luck.
What I want to do then is change the postfix behaviour so that, instead of generating a bounce email form MAILER-DAEMON the mail is rejected during the SMTP transaction.