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.
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
Most helpful comment
Anyone? This is something we should add to the FAQ as it may be useful to others.