On Sat, Apr 01, 2023 at 07:02:51PM +0100, EML via Postfix-users wrote:

> How, exactly, do postfix and dovecot communicate when postfix attempts 
> to determine whether to deliver a message to the dovecot LDA, or to 
> bounce it? In other words, how does postfix decide to bounce foo, and 
> deliver bar, in these log messages:
> 
> postfix/pipe[11857]: 933BCA071A: to=<f...@example.com>, relay=dovecot, 
> ... status=bounced (user unknown)
> postfix/pipe[12266]: 8AD51A071A: to=<b...@example.com>, relay=dovecot, 
> ... status=sent (delivered via dovecot service)

With delivery via pipe(8) the success or failure is determined via the
exit code of the LDAP command.  The supported exit codes are inherited
from Sendmail, and listed in <sysexits.h>.

> The reason I ask is that the obvious answer with the main.cf setup 
> doesn't appear to be sufficient, and dovecot appears to check whether or 
> not the recipient exists in the userdb passwd file before allowing delivery.

Dovecot either does or does not know how to deliver mail for a
particular address, that's a dovecot internal matter.  Postfix has no
influence over that decision.

> I have postfix set up for virtual hosts, as follows:
> 
> virtual_mailbox_domains = example.com, sub.example.com
> virtual_mailbox_maps    = hash:/var/www1/vdomains
> virtual_transport = dovecot
> 
> where vdomains contains:
> 
> b...@sub.example.com  example.com/test/
> b...@example.com      example.com/test/
> @sub.example.com     example.com/test/
> @example.com         example.com/test/

This determines which addresses Postfix will accept for delivery, but
not whether delivery will succeed, or where the mail will be stored,
because you've delegated delivery to a non-Postfix LDA.

> postfix will deliver to b...@example.com, but not f...@example.com. I 
> can't deliver anything to the subdomain. The interesting thing is that 
> 'bar' already has a dovecot mailbox (the 'test' mailbox), but 'foo' doesn't.
> 
> If this is correct, how do I do wildcard deliveries to dovecot, 
> particularly for the subdomain?

Configure dovecot to deliver these.  Postfix is done when it accepts the
message for delivery via the LDA.  The LDA decides what and where
actually gets delivered.

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to