unexpected delivery location

lists lists at merit.unu.edu
Tue Aug 22 17:23:13 EEST 2017


Hi,

We're running dovecot 2.2.13, virtual users, with postfix. We have an 
olddomain and a new domainname. To 'translate' *@olddomain into 
*@newdomain, I have configured:

> cat /etc/postfix/canonical
> @olddomain.com   @newdomain.com

While this seems to work, lately we have noticed that dovecot 
occasionally creates mailboxes for non-existent users, like:
> /var/vmail/...username
> /var/vmail/20username

This only seems to be happening for mails sent to *olddomain*

Looking at the source of these mails, they are indeed sent to 
20username at olddomain.com and ...username at olddomain.com

Mail headers sample:
> Delivered-To: 20username at newdomain.com
> Received: from server1.newdomain.com (server2.newdomain.com [x.y.z.q])
>         by server3.newdomain.com (Postfix) with ESMTPS id 067B4812CF29E
>         for <20username at olddomain.com>; Thu, 13 Jul 2017 19:05:02 +0200 (CEST)

Why doesn't the emailadress 20username at newdomain.com in the above 
generate an error, but instead are delivered to a newly created mailbox?

My feeling is that something is wrong with the way I created the alias 
for olddomain -> newdomain with the canonical-file . Does that make sense?

Our goal is to accept *@olddomain.com like it was sent to 
*@newdomain.com, including delivery failures for nonexistent mailboxes 
like 20username

We configured postfix like:
> canonical_maps = hash:/etc/postfix/canonical
> virtual_alias_maps = ldap:/etc/postfix/ad-mailboxes.cf, ldap:/etc/postfix/ad-groups.cf
> virtual_uid_maps = static:5000
> virtual_gid_maps = static:5000
> virtual_transport = dovecot

Verified that this config works for newdomain, using:
> root at mail:/etc/postfix# postmap -q alias at newdomain.com  ldap:/etc/postfix/ad-mailboxes.cf
> userid at newdomain.com
> root at mail:/etc/postfix# postmap -q alias at olddomain.com  ldap:/etc/postfix/ad-mailboxes.cf
> root at mail:/etc/postfix# 
olddomain gives no result.

Then, from master.cf:
> dovecot unix - n n - - pipe
>   flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-lda -f ${sender} -a ${recipient} -d ${user}@${nexthop}

Finally, the mail location as defined in dovecot:

> mail_location = maildir:/var/vmail/%Ln/Maildir:LAYOUT=fs:DIRNAME=mAildir

So, can anyone explain why for mails to olddomain, dovecot creates new 
mailboxes, instead of simply generating an error?


More information about the dovecot mailing list