This is an implementation of https://code.launchpad.net/~jimpop/mailman/check_subscriber for Mailman 3.
A Postfix milter checks whether an email address is a subscriber to a mailing list. If it is not, it rejects the mail during the SMTP transaction.
This avoids sending backscatter-bounces, and avoids blackholing messages from non-subscribers — the sender's MTA will generate an error.
In master.cf:
127.0.0.1:26005 inet n n n - 1 spawn
user=nobody argv=/etc/postfix/check_mailman_subscriber [email protected]
And in main.cf:
smtpd_restriction_classes = subscribers_test
smtpd_sender_restrictions = check_recipient_access hash:/etc/postfix/check_subscribers, permit
subscribers_test = check_sender_access tcp:127.0.0.1:26005, permit
And in check_subscribers:
[email protected] subscribers_test