How To Block Email Using Subject Headers In Postfix

Published Date Author: , Posted December 7th, 2021 at 12:05:44pm

I needed to block email based on the Subject header.

The solution is simple:

Edit main.cf as root and uncomment or add:

Next, creaate or edit /etc/postfix/header_checks as root and add the following line:

Finally, run sudo postfix reload

NOTE: Do NOT add the “i” after the regular expression! It is case-insensitive by default, and adding the “i” will break it!

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.