Docker-mailserver: Blackhole Email-Address

Created on 1 Nov 2018  路  9Comments  路  Source: tomav/docker-mailserver

Is there a way to define an email-adress which routes all incoming mails to /dev/null? I only see the possibility to prevent an email-address from receiving mails, but that generates an error-message returning to the sender.

help wanted question

Most helpful comment

Anyone? This is something we should add to the FAQ as it may be useful to others.

All 9 comments

There is no such address available. You could set up a sieve rule on the account that drops the email.

I would like to know more about the sieve rule to achieve this.

Anyone? This is something we should add to the FAQ as it may be useful to others.

Looking at the documentation of Sieve and the wiki page on filters, I believe you could do it by adding a dummy account ([email protected]) and then creating the /var/mail/domain.com/dummy/.dovecot.sieve file simply containing:

discard;

That wiki page also describes global filters though, meaning you might not even need to create the dummy account in the first place. I haven't tested this, but I think if you make config/before.dovecot.sieve contain the following, it should work.

if address :matches "to" "[email protected]"
{
    discard;
}

Can't we just use 'DISCARD' instead of 'REJECT' in the postfix virtual config?

I would be vary of doing that as it would affect all installations and it is a big change in behavior. We could add an environment option to control it though. Or even today I think it can be changed in the override file?

@Fahrenholz, I think this is already handled in the FAQ.

https://github.com/tomav/docker-mailserver/wiki/FAQ-and-Tips#how-can-i-delete-all-the-e-mails-for-a-specific-user

It sure looks like that. @Fahrenholz can we close?

Sorry, yes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShuP1 picture ShuP1  路  4Comments

jholster picture jholster  路  4Comments

landergate picture landergate  路  4Comments

nicklayb picture nicklayb  路  4Comments

cottonthread picture cottonthread  路  4Comments