Exclude specific address from catch all address?

Hi everyone,

I use a catch all address and it works great. One of these addresses now gets hit by a ridiculous amount of spam. Right now I just set up a filter which immediately deletes all mail sent to that specific address and this works fine. Nevertheless every email needs to be processed by the server and the sender sees the mail as delivered and will thus continue sending mails.

My question: Is there a possibility to exclude one or more addresses from the catch all? As in: MIAB answers “this email address does not exist”?


Ahh, the bad side of catchall accounts revealed.

There is no supported way of doing this other than using the filters within Roundcube.

That said, postfix most likely has a way of doing this which would be an unsupported modification to your MiaB instance. I am not familiar with the specifics though.

Thanks for your promt reply @alento!
Is this something that is requested often? Or am I the only one who has this problem?
I’m asking to check if it’s worth to bring up this topic on Github…

So far, you’re the first that I can recall. I do not think that you’d get any traction bringing this up on Github - but I do NOT want to discourage you from making the suggestion.

This can be done

sudo nano /etc/postfix/rejected_recips
edit the file to contain a list of emails you want to REJECT, for example, it can contain just the following line (or add more, each on their own line/row:
user@domain.com REJECT
user2@domain.com REJECT

Then, sudo nano /etc/postfix/main.cf
Find the line that starts with “smtpd_recipient_restrictions=”
add in after the last entry, add a comma then without the quotes: “check_recipient_access hash:/etc/postfix/rejected_recips”

Should look something like this:

smtpd_recipient_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_rbl_client zen.spamhaus.org,reject_unlisted_recipient,check_policy_service inet:,check_recipient_access hash:/etc/postfix/rejected_recips

Then issue these commands:
sudo postmap /etc/postfix/rejected_recips
sudo service postfix restart

NOTE: Every time you update MIAB you will have to edit main.cf --Since this is an unsupported modification (as mentioned above by ALENTO, make sure you backup before you edit.


I’m also very interested in this feature being included in the MiaB management interface, so that manual postfix configurations aren’t overwritten with every MiaB update/reconfiguration.

I use catch-all for my domains as a way to separate mail streams and identify when something has been compromised or been sold to non affiliated marketing companies. Sometimes a recipient address is so compromised and receives so much spam, that it isn’t worth dealing with anymore, and needs to be rejected at the smtp level.

Thank you for the excellent mail management package!

What’s the disadvantage of a sieve filtering rule which rejects a mail? They would not be overwritten after an update and roundcube provides - more or less - an interface to it. Or am I mistaken?

@usachris Thanks for the information. I try to keep my modifications to MiaB at the bare minimum, but this is one that would be handy if the need arises.