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”?

1 Like

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:127.0.0.1:10023,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.

1 Like