My personal server is happily managing virtual mail domains without any
trouble, but I'm now trying to troubleshoot a work server that is being a
little more stubborn. It has one primary domain (booyahmedia) and two
virtual domains (teamsites.com and virtualvow.com).

I've set up a local test account on the server called "testaccount." Mail is
delivered just fine to that account on the primary domain:

Oct 22 10:02:37 booyahmedia postfix/smtpd[10240]: connect from
mail-yx0-f171.google.com[209.85.213.171]
Oct 22 10:02:43 booyahmedia postfix/smtpd[10240]: 3574630437:
client=mail-yx0-f171.google.com[209.85.213.171]
Oct 22 10:02:43 booyahmedia postfix/cleanup[10256]: 3574630437:
message-id=<aanlktiksotckamwhbtdkxg+otf6cu3xoicldi15ok...@mail.gmail.com>
Oct 22 10:02:43 booyahmedia postfix/qmgr[8636]: 3574630437:
from=<testsen...@gmail.com>, size=1639, nrcpt=1 (queue active)
Oct 22 10:02:43 booyahmedia postfix/local[10257]: 3574630437:
to=<testacco...@booyahmedia.com>, relay=local, delay=5.8,
delays=5.8/0.02/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox)
Oct 22 10:02:43 booyahmedia postfix/qmgr[8636]: 3574630437: removed

Next, I set up a test virtual alias on each of the virtual domains. The
/etc/postfix/virtual file is:

teamsites.com                           #Team Sites
testing...@teamsites.com                testaccount

virtualvow.com                          #Virtual Vow
testing...@virtualvow.com               testaccount      

If I send a test email from Gmail to an address on either of the virtual
domains, I get some strange entries in the log:

Oct 22 10:04:32 booyahmedia postfix/smtpd[10507]: connect from
mail-yw0-f43.google.com[209.85.213.43]
Oct 22 10:04:32 booyahmedia postfix/trivial-rewrite[10510]: warning: do not
list domain teamsites.com in BOTH virtual_alias_domains and relay_domains
Oct 22 10:04:38 booyahmedia postfix/smtpd[10507]: C320B3041C:
client=mail-yw0-f43.google.com[209.85.213.43]
Oct 22 10:04:38 booyahmedia postfix/cleanup[10524]: C320B3041C:
message-id=<aanlktikkl_uzq-r0t5gqjc32m_yxbazy+39_nuq1r...@mail.gmail.com>
Oct 22 10:04:38 booyahmedia postfix/qmgr[10468]: C320B3041C:
from=<testsen...@gmail.com>, size=1631, nrcpt=1 (queue active)
Oct 22 10:05:08 booyahmedia postfix/smtp[10525]: connect to
com.com[216.239.113.101]: Connection timed out (port 25)
Oct 22 10:05:09 booyahmedia postfix/smtpd[10507]: disconnect from
mail-yw0-f43.google.com[209.85.213.43]
Oct 22 10:05:38 booyahmedia postfix/smtp[10525]: connect to
com.com[216.239.122.102]: Connection timed out (port 25)
Oct 22 10:05:38 booyahmedia postfix/smtp[10525]: C320B3041C:
to=<testacco...@com.com>, orig_to=<testing...@teamsites.com>, relay=none,
delay=66, delays=6.1/0.02/60/0, dsn=4.4.1, status=deferred (connect to
com.com[216.239.122.102]: Connection timed out)

First, I'm trying to figure out why it's giving me that trivial-rewrite
warning because teamsites.com appears only in virtual_alias_domains in
main.cf. The only references I can find with Google seem to address
subdomains of the primary domain, but that's not the case here.

Second, it seems that Postfix thinks that the local hostname or domain is
"com.com" instead of "booyahmedia.com" because it's trying to deliver the
message to testacco...@com.com instead of testacco...@booyahmedia.com. That
one's really got me scratching my head.

I can fudge it so that messages will get delivered to the local
"testaccount" account by editing /etc/postfix/virtual to read:

teamsites.com                   #Team Sites
testing...@teamsites.com        testacco...@booyahmedia.com

That at least delivers mail sent to the virtual alias to the proper local
account, but I still get the "do not list teamsites.com in BOTH." warning in
the log. In any case, I don't want to fudge it anyway - I'd rather it work
correctly.

I've checked through all the network settings I can think of (/etc/hosts
/etc/resolv.conf) to see why Postfix might be thinking that com.com is the
localhost, 

Here are some outputs from the shell to help give some context and aid
troubleshooting:

# 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
debug_peer_level = 2
disable_vrfy_command = yes
html_directory = no
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_data_restrictions = reject_unauth_pipelining,        permit
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,        reject_unauth_destination,
reject_unknown_reverse_client_hostname,        warn_if_reject
reject_non_fqdn_helo_hostname,        warn_if_reject
reject_invalid_helo_hostname,        warn_if_reject
reject_unknown_helo_hostname,        reject_non_fqdn_sender,
reject_unknown_sender_domain,        reject_non_fqdn_recipient,
reject_unknown_recipient_domain,        check_helo_access
hash:/etc/postfix/helo_access,        check_client_access
pcre:/etc/postfix/fqrdns.pcre,        reject_rbl_client zen.spamhaus.org,
reject_rbl_client psbl.surriel.com,        reject_rhsbl_client
dbl.spamhaus.org,        reject_rhsbl_sender dbl.spamhaus.org,
reject_rhsbl_helo dbl.spamhaus.org,        permit
smtpd_sasl_auth_enable = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains = virtualvow.com, teamsites.com
virtual_alias_maps = hash:/etc/postfix/virtual

# hostname
booyahmedia.com

# postconf | grep relay_domains
fast_flush_domains = $relay_domains
parent_domain_matches_subdomains =
debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqp
d_authorized_clients,relay_domains,smtpd_access_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
relay_domains = $mydestination
relay_domains_reject_code = 554

# postconf | grep virtual_alias_domains
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
virtual_alias_domains = virtualvow.com, teamsites.com

Any ideas? How can I test to see what Postfix THINKS the localhost and
localdomain are? Thanks in advance for any clues.

Steve

Reply via email to