I recently switched from using flat virtual files to using mysql to manage a virtual table.
Email addresses that were set up prior to the switchover can be reached. But emails set up afterwards can't. I added verbose logging to the smtp processes by adding the -v parameter in master.cf With old email addresses set up prior to mysql, the resolve_clnt function seems to recognize that the domain is local, even though it doesn't initially see the email address in the virtual alias table (not sure why) With the new email addresses that are managed by mysql, resolve_clnt doesn't seem to be looking up the email in the virtual table. Instead, it comes back with the host IP address -- this is the relayhost value set in main.cf. Here are the maillog entries for the email set up prior to the mysql switch: [root@miltermatic log]# grep "[email protected]" maillog Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: < mail-qc0-f177.google.com[209.85.216.177]: RCPT TO:<[email protected]> Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: extract_addr: input: <[email protected]> Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: smtpd_check_addr: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: send attr address = [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: input attribute value: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: rewrite_clnt: local: [email protected] -> [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: send attr address = [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: input attribute value: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: resolve_clnt: `' -> `[email protected]' -> transp=`error' host=`User unknown in virtual alias table' rcpt=`[email protected]' flags= class=alias Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: ctable_locate: install entry key [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: extract_addr: in: <[email protected]>, result: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: check_mail_access: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: ctable_locate: move existing entry key [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: check_access: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: reject_unauth_destination: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: permit_auth_destination: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: ctable_locate: leave existing entry key [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: reject_non_fqdn_address: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: reject_unknown_address: [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: ctable_locate: leave existing entry key [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: ctable_locate: leave existing entry key [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: maps_find: recipient_canonical_maps: [email protected]: not found Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: mail_addr_find: [email protected] -> (not found) Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: maps_find: canonical_maps: [email protected]: not found Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: mail_addr_find: [email protected] -> (not found) Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: maps_find: virtual_alias_maps: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): [email protected] = [email protected] Aug 7 17:52:13 miltermatic postfix/smtpd[15169]: mail_addr_find: [email protected] -> [email protected] Aug 7 17:52:14 miltermatic postfix/smtp[13404]: AEE0914A806A: to=<[email protected]>, orig_to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.6, delays=0.61/0/0/0.99, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as BADEC14A8070) here are the maillog entries for the email set up after the mysql switch: [root@miltermatic log]# grep "[email protected]" maillog Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: < mail-qc0-f170.google.com[209.85.216.170]: RCPT TO:<[email protected]> Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: extract_addr: input: <[email protected]> Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: smtpd_check_addr: [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: send attr address = [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: input attribute value: [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: rewrite_clnt: local: [email protected] -> [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: send attr address = [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: input attribute value: [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: resolve_clnt: `' -> `[email protected]' -> transp=`smtp' host=`67.22.105.2' rcpt=`[email protected]' flags= class=default Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: ctable_locate: install entry key [email protected] Aug 7 17:50:03 miltermatic postfix/smtpd[15246]: extract_addr: in: <[email protected]>, result: [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: check_mail_access: [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: ctable_locate: move existing entry key [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: check_access: [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: reject_unauth_destination: [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: permit_auth_destination: [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: ctable_locate: leave existing entry key [email protected] Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: NOQUEUE: reject: RCPT from mail-qc0-f170.google.com[209.85.216.170]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-qc0-f170.google.com> Aug 7 17:50:04 miltermatic postfix/smtpd[15246]: > mail-qc0-f170.google.com[209.85.216.170]: 554 5.7.1 <[email protected]>: Relay access denied I get "Relay access denied" if I try sending email to that domain from gmail. If I try sending email to that domain with a manual telnet smtp session to localhost port 25 on the machine postfix is running on, it goes through fine: Aug 7 18:08:29 miltermatic postfix/smtpd[15246]: ctable_locate: purge entry key [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: < SERVER9678[127.0.0.1]: rcpt to: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: extract_addr: input: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: smtpd_check_addr: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: send attr address = [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: input attribute value: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: rewrite_clnt: local: [email protected] -> [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: send attr address = [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: input attribute value: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: resolve_clnt: `' -> `[email protected]' -> transp=`smtp' host=`67.22.105.2' rcpt=`[email protected]' flags= class=default Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: ctable_locate: install entry key [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: extract_addr: in: [email protected], result: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: check_mail_access: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: ctable_locate: move existing entry key [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: check_access: [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: ctable_locate: leave existing entry key [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: maps_find: recipient_canonical_maps: [email protected]: not found Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: mail_addr_find: [email protected] -> (not found) Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: maps_find: canonical_maps: [email protected]: not found Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: mail_addr_find: [email protected] -> (not found) Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: maps_find: virtual_alias_maps: mysql:/etc/postfix/mysql-virtual.cf(0,lock|fold_fix): [email protected] = [email protected] Aug 7 18:17:51 miltermatic postfix/smtpd[20072]: mail_addr_find: [email protected] -> [email protected] Aug 7 18:18:11 miltermatic postfix/smtp[19830]: E8FBA14A8066: to=<[email protected]>, orig_to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=29, delays=29/0/0/0.3, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as CACAD14A805F) Any help would be greatly appreciated! Thank you Scott Brown
