How to send mail to mailbox with disabled domain?

Kai Schaetzl maillists at conactive.com
Wed Sep 12 00:48:40 EEST 2018


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.

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.

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.

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




More information about the dovecot mailing list