Score:1

Postfix/Dovecot setup throws "User doesn't exist" despite virtual user existing

ng flag

I have configured Postfix and Dovecot according to the documentation for virtual setups and LMTP transport:

https://www.postfix.org/VIRTUAL_README.html

/usr/local/etc/postfix/main.cf:
    virtual_transport = lmtp:unix:/path/name/to/socket 
    virtual_mailbox_domains = example.com example2.com
    virtual_mailbox_maps = hash:/usr/local/etc/postfix/vmailbox
    virtual_alias_maps = hash:/usr/local/etc/postfix/virtual

/usr/local/etc/postfix/vmailbox:
    [email protected]    whatever
    [email protected]   whatever

/usr/local/etc/postfix/virtual:
    [email protected] [email protected]

/usr/local/etc/dovecot/users:
    [email protected]:{SHA512-CRYPT}$6$/kTQFQ[...]/::::::userdb_quota_rule=*:storage=2048M
    [email protected]:{SHA512-CRYPT}$6$/kTQFQ[...]/::::::userdb_quota_rule=*:storage=2048M

If I send emails from external addresses, it is accepted and properly transported via LMTP. Generally everything works as expected.

To remain in this example, when I send an email from [email protected] via authenticated SMTP submission to [email protected], it always throws:

<[email protected]>: host mx.example.com[private/dovecot-lmtp] said: 550 5.1.1
    <[email protected]> User doesn't exist: [email protected] (in reply
    to RCPT TO command)

I'm aware that the error is thrown by Dovecot's LMTP. What I don't understand is why everything works from unauthenticated external addresses but not when sending authenticated on my own.

I'm thankful for any pointers. If more configuration data is needed, let me know and I will add it.

anx avatar
fr flag
anx
There are a few ways to create unintended differences between mail submitted via *different `smtpd` instances* (rows in `master.cf`), which is preferably the case for external vs authenticated submission, I suppose it would be obvious looking at the output of the `postconf -n` and `postconf -M` commands.
ng flag
Thanks for the nudge, it is highly probable that this is the cause. I believe I have found the issue and will answer it to possibly help others in the future.
Score:1
ng flag

In Postfix's master.cf there was a setting I don't remember having made:

-o receive_override_options=no_address_mappings

This, according to Postfix documentation, does what its name suggests:

Disable canonical address mapping, virtual alias map expansion, address masquerading, and automatic BCC (blind carbon-copy) recipients. This is typically specified BEFORE an external content filter.

This obviously couldn't work. Once removed it appears to work now.

anx avatar
fr flag
anx
I know very few reasons for ever using that option.. do you have any spam filtering setup to receive and then pass messages back to postfix (then that option would prevent applying rewrites & aliasing a second time)? If so, check whether you actually *do* want that option - just in a different place between initial receipt and further processing.
ng flag
Exactly, hence my confusion. I wouldn't know why I would ever use it. Spam filtering happens with rspamd via milter. Directly below was a commented-out statement regarding an approach to DKIM signing, which I ended up using an rspamd module for. My best guess is that this is part of the original approach and I just forgot to comment it out. Still, it's really weird.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.