How to create private blocklist
This will create a blocklist that will apply to sender
from for all email received by the server:
Create the rules list file:
$ sudo nano /etc/postfix/sender_access
Add to the file the desired action or actions:
firstname.lastname@example.org DISCARD example.net DISCARD
Note that the
DISCARD option will recieve the mail to the server and silently delete it without delivering to any inboxes. This is generally preferable to the
REJECT option which will send a message to the sending server that the message was blocked, which the server commonly will generate a response message back to the user sending the message.
For more details and options on the
sender_access file, see
Create a database file:
$ sudo postmap /etc/postfix/sender_access
$ sudo nano /etc/postfix/main.cf
$ sudo service postfix restart
Emails sent to the server with
example.net in the
from field will now be silently discarded.
Note to check that MiaB has not commented out the edited line after MiaB updates or when running any
mailinabox or related scripts, but system updates (e.g.,
apt-get) should not alter the file.
While this should work generally well with MiaB, the configuration may conflict with other configurations due to the nature of how
smtpd_recipient_restrictions. If you experience unexpected problems after following this guide and determine they are related to this configuration, please post a new topic in the Unsupported Modifications category.