How to send mail to mailbox with disabled domain?

Gerald Galster list+dovecot at gcore.biz
Wed Sep 12 12:45:52 EEST 2018


If you want to accept delivery for one address only and reject all other
adresses in the domain, you can do this with postfix's access table:

http://www.postfix.org/access.5.html

A hint to transport tables: 
	user1 at example1.com	lmtp:$HOW_TO_REACH_THE_MX
	user1 at example1.com	lmtp:[$HOW_TO_REACH_THE_MX]

If you enclose the mx in [] postfix will just take the value as is
and not force any MX lookups.

Last but not least you could configure mail routing by sender if
necessary: http://www.postfix.org/postconf.5.html#sender_dependent_relayhost_maps

Best regards,
Gerald


> Am 12.09.2018 um 10:58 schrieb Jochen Bern <jochen.bern at binect.de>:
> 
> On 09/11/2018 08:20 PM, Kai Schaetzl wrote:
>> I have to disable mail acceptance for example1.com. 
>> If not, mail sent *from* that server (e.g. from a web form) to that domain 
>> will not leave the server. 
>> However, if I disable example1.com for mail dovecot lmtp will not deliver 
>> mail to this mail box anymore, although the mailbox still exists.
> 
> First and foremost, you are describing a major routing problem *for the
> MTA*. You want it to do local delivery (via LMTP) for
> user1 at example1.com, but forward mail addressed to foobar at example1.com to
> that domain's current MX. Since MTAs usually(!) decide that based on the
> *domain*, you have a need for some off-the-textbook tweaking right
> there. And the config to make *dovecot* work as needed would need to
> pick up from there.
> 
> If we're talking postfix, my first idea would be to make example1.com a
> virtual alias domain and set up a transport table with entries
> 	user1 at example1.com	local:
> 	# ... etc. etc. ...
> 	example1.com		smtp:$HOW_TO_REACH_THE_MX
> (with $HOW_TO_REACH_THE_MX being anything from "use the official MX from
> DNS" to "contact this internal IP on this port, *without* DNS lookups",
> whichever your (internal?) networking necessitates).
> 
> http://www.postfix.org/transport.5.html
> 
> With a bit of luck, that might already "contain" the weirdness to the
> point that neither the MX nor dovecot need config hacks.
> 
> Regards,
> -- 
> Jochen Bern
> Systemingenieur
> 
> www.binect.de
> www.facebook.de/binect
> 



More information about the dovecot mailing list