How to send mail to mailbox with disabled domain?

Steffen Kaiser skdovecot at inf.h-brs.de
Wed Sep 12 08:25:32 EEST 2018


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 11 Sep 2018, Kai Schaetzl wrote:
> Gerald Galster wrote on Tue, 11 Sep 2018 20:49:17 +0200:
>
>> Is this a dovecot problem on your side? dovecot usually accepts mail
>> from MTA like postfix, so it would be better to remove example1.com from
>> postfix relaydomains (mailbox domains, alias domains, ...). Then there
>> is no delivery to dovecot. Most MTAs ignore MX records - if a domain is
>> configured locally, it gets delivered.
>
> Thanks for your reply.
> I don't want the MTA to deliver that domain. As an email address.
> But I want to deliver to the virtual mailbox of that name.
> That's the point. I make a distinction. lmtp doesn't ;-)
>
> I don't want some.address at example1.com getting delivered.
> But I want some.otheraddress at example2.com getting delivered.
> Which just happens to be aliased to the mailbox "user1 at example1.com".
> And example1.com is disabled for mail.

"aliased to" seems to be a job for the MTA, hence, it will never deliver 
to Dovecot, if the domain is disabled there.

> I used to have mailbox names of "user1" (system accounts), not of
> "user1 at example1.com" (virtual mailboxes). There doesn't seem to be a way
> to have virtual mailbox names like "user1". Not a problem - until you
> remove the mailbox domain from the accepted domains. Then it suddenly
> doesn't deliver although it's not getting used as an email address.
>
> Delivery is done via postfix/lmtp which actually is dovecot lmtp if I
> understand correctly. And lmtp resolves "everything". I can't deliver to a
> virtual mailbox named only "user1" it seems (I tried it some months ago
> and hit several weird problems, so I stopped that). I have to use a
> "user at domain" combination mailbox and the domain has to be in the local-
> host-names table or postfix/lmtp won't understand it's local.
> But then it will try to file all mail for this domain locally and it will
> also accept mail for this domain from outside.

You can configure multiple userdb's in Dovecot. Also, a userdb of LDAP or 
SQL can use %u, %n and %d. Hence, you can configure Dovecot to "find" the 
user by "user1" and "user1 at example1.com". However, you must ensure that 
only one entry is found.

However, can you configure Postfix to pass one kind of users without 
domain and the other kind with domain?

> So far I came up with two ways to work around this problem:
>
> 1. use another domain for example1.com mailbox names (for instance
> example1.localmail) and put everything in place that it resolves locally
> and is in the local-host-names table. It works, I tested it. But this
> requires changing all the already created mailbox names. And change the
> code behind the web interface.

This depends on the userdb. You can use the dummy domain as key and return 
specific mail locations.

> 2. set example1.com to be deliverable again and don't setup any addresses
> (aliases) for this domain. As the mailboxes are not directly deliverable
> to, only if they are aliased, there is no way to send to this domain from
> outside. And I have to put up a few aliases for it that forward mail
> externally to some subdomain that isn't locally configured. Or just have
> it sent right-away this way.
>
> Both things are not the real deal, though.
>
> Kai
>
>
>

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBW5ijTMQnQQNheMxiAQKBOQgAtxitoGR1lHLIEGi7WANWDa/N7QbrRypt
LVel1D6xrbEyDZva8eRiapuf9O0LRpjEdOCPLkxQZPu45a/kzL7/ohcYnYsP7zW+
7Xt0zKArFvQ/NS+7wrYL6gh/mYQwtpF53/R1jnOG6qvR1T6MZtvDfcTl8FTWftG5
WVdafzUka20caxicRHX/zLSYhpOBpycCoUezEm3msXb1RrTywat8qiagFhS2Ui5q
teHwwQQUPDCizhkoLi1rOrgn715oNQKI+5YkTMVgmrCygYCsURRN5M0p6uyOzJAp
GNYFGjbgbWqCtrYXPkac5/y9PCuhPQn/yUHVIraLjzGd/1OL8wyK/Q==
=Z5Mu
-----END PGP SIGNATURE-----


More information about the dovecot mailing list