Problem: How can I blacklist mail receipients in UCS

Problem

How can I blacklist mail receipients in UCS?

Solution

Step 1

Create a listfile containing the receipients, that should not be reachable for your mailserver:
root@dc0:~ # vi /etc/mail/blacklist

the file must have this structure:

<mailadress><TAB><ACTION><TAB><Message>

f.e.

name@domain.tld   REJECT   Delivery to this user is prohibited

You can also set a complete domain (domain.tld) or subdomains (.domain.tld) or mail addresses (name@) see man page: http://www.postfix.org/access.5.html

Step 2

ucr set mail/postfix/smtpd/restrictions/recipient/09='check_recipient_access hash:/etc/postfix/blacklist'
systemctl restart postfix.service
postmap /etc/postfix/blacklist
Mastodon