Reject mails sent to a specific local address (postfix set up with workaround.org ISP Mail)

  1. Create a file named "blocked" in /etc/postfix (touch /etc/postfix/blocked)
  2. Edit /etc/postfix/main.cf and append the virtual_alias_maps with pcre:/etc/postfix/blocked. Your end result should look like
    ...
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf,pcre:/etc/postfix/blocked
    ...
  3. Edit /etc/postfix/blocked and add the local address for which you want to discard incoming mails appended with <tab>discard:. It should look like
    yourlocaladdressyouwantedtohaveblocked@yourdomain.com discard:
  4. Restart postfix
  5. Tail your mail log (tail -f /var/log/mail.log).
  6. Try to send a mail to the mail you have blocked. The log should now contain a line similar to the following:
    NOQUEUE: reject: RCPT from mail-am6eur05on2060.outbound.protection.outlook.com[40.107.22.60]: 451 4.3.0 <yourlocaladdressyouwantedtohaveblocked@yourdomain.com>: Temporary lookup failure; from=<yourexternalmail@mailservice.com> to=<yourlocaladdressyouwantedtohaveblocked@yourdomain.com>> proto=ESMTP helo=<EUR05-AM6-obe.outbound.protection.outlook.com>

Notes

You can change the named of the "blocked" file with anything you want, as long as you use the same filename in main.cf when appending virtual_alias_maps.

More PCRE information can be found at https://www.postfix.org/PCRE_README.html

Since PCRE is regex you can add patterns to discard instead of full addresses if you wish. More information at https://serverfault.com/a/1045056/277567