dave102
By:
dave102

Postfix: can only receive outside mail for a single virtual user

November 5, 2015 804 views
Email

I set up postfix/dovecot/mysql following:

https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin

I have two domains pointing to the server, dom1.com and dom2.com. I inserted two users into the virtual_users table: A@dom1.com and B@dom2.com.

I can send mail from both users OK. I can receive mail from an outside server for A@dom1.com but I cannot receive mail from an outside server for B@dom2.com. However I can receive a mail for B@dom2.com if I send it from A@dom1.com.

This makes no sense at all to me. I thought maybe postfix only picks the first record in virtual_users so I changed the order but it has not helped.

My main.cf is:

smtpdbanner = $myhostname ESMTP $mailname (Ubuntu)
biff = no
appenddotmydomain = no
readmedirectory = no
smtpd
tlscertfile=/etc/ssl/mycerts/dovecot.cer
smtpdtlskeyfile=/etc/ssl/private/dovecot.key
smtpd
usetls=yes
smtpd
tlsauthonly = yes

smtpdsasltype = dovecot
smtpdsaslpath = private/auth
smtpdsaslauthenable = yes
smtpd
recipientrestrictions =
permit
saslauthenticated,
permit
mynetworks,
rejectunauthdestination

myhostname = dsb303
aliasmaps = hash:/etc/aliases
alias
database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailboxsizelimit = 0
recipientdelimiter = +
inet
interfaces = all

virtualtransport = lmtp:unix:private/dovecot-lmtp
virtual
mailboxdomains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual
mailboxmaps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual
alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf

All the referred virtual files are exactly as per the article.

The mail log shows delivery for A@dom1.com but nothing for a mail I sent to B@dom2.com

I can connect to the mailbox for B@dom2.com and the log shows the connection but the mailbox contains no mail. I can also connect with Squirrelmail which confirms the empty mailbox.

Would appreciate any ideas on how to solve this.

Thanks.

Be the first one to answer this question.