postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: weirdness and relay_domains warning weirdness and relay_domains warning

From: Steve Jenkins <steve_at_nospam>
Date: Fri Oct 22 2010 - 16:37:34 GMT
To: <>

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 ( and

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[]
Oct 22 10:02:43 booyahmedia postfix/smtpd[10240]: 3574630437:[]
Oct 22 10:02:43 booyahmedia postfix/cleanup[10256]: 3574630437:
Oct 22 10:02:43 booyahmedia postfix/qmgr[8636]: 3574630437:
from=<>, size=1639, nrcpt=1 (queue active)
Oct 22 10:02:43 booyahmedia postfix/local[10257]: 3574630437:
to=<>, 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: #Team Sites testaccount #Virtual Vow 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[]
Oct 22 10:04:32 booyahmedia postfix/trivial-rewrite[10510]: warning: do not
list domain in BOTH virtual_alias_domains and relay_domains
Oct 22 10:04:38 booyahmedia postfix/smtpd[10507]: C320B3041C:[]
Oct 22 10:04:38 booyahmedia postfix/cleanup[10524]: C320B3041C:
Oct 22 10:04:38 booyahmedia postfix/qmgr[10468]: C320B3041C:
from=<>, size=1631, nrcpt=1 (queue active)
Oct 22 10:05:08 booyahmedia postfix/smtp[10525]: connect to[]: Connection timed out (port 25)
Oct 22 10:05:09 booyahmedia postfix/smtpd[10507]: disconnect from[]
Oct 22 10:05:38 booyahmedia postfix/smtp[10525]: connect to[]: Connection timed out (port 25)
Oct 22 10:05:38 booyahmedia postfix/smtp[10525]: C320B3041C:
to=<>, orig_to=<>, relay=none,
delay=66, delays=6.1/0.02/60/0, dsn=4.4.1, status=deferred (connect to[]: Connection timed out)

First, I'm trying to figure out why it's giving me that trivial-rewrite
warning because appears only in virtual_alias_domains in 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
"" instead of "" because it's trying to deliver the
message to instead of 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: #Team Sites

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

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 is the

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

# 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 =
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,
reject_rbl_client, reject_rhsbl_client, reject_rhsbl_sender,
reject_rhsbl_helo, permit
smtpd_sasl_auth_enable = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains =,
virtual_alias_maps = hash:/etc/postfix/virtual

# hostname

# postconf | grep relay_domains
fast_flush_domains = $relay_domains
parent_domain_matches_subdomains =
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 =,

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