Author:
erics , December 7th, 2021
I needed to block email based on the Subject header. The solution is simple: Edit main.cf as root and uncomment or add:
header_checks = regexp : / etc / postfix / header_checks
Next, creaate or edit /etc/postfix/header_checks as root and add the following line:
/ subject : \ sbad subject text here / REJECT header_checks NO SPAM ALLOWED
/ subject : \ stest subject text here / DISCARD header_checks NO SPAM ALLOWED
Finally, run sudo postfix reload NOTE: Do NOT add the “i” after the regular expression! It is case-insensitive by […]
Categories: How-To's , Technology Tags: Block , Check , Checks , Discard , Header , header_checks , headers , howto , PostFix , Reject , Spam , Subject , tips
| No comments
Author:
erics , June 3rd, 2011
By default, the Postfix SMTP server accepts any sender address. You block email addresses using the sender_access file:
# cd /etc/postfix
# vi sender_access
baduser @ baddomain . com REJECT
# postmap hash:sender_access
# vi recipient_access
baduser @ baddomain . com REJECT
# postmap hash:recipient_access
# vi main.cf
smtpd_sender_restrictions = check_sender_access hash : / etc / postfix / sender_access
smtpd_recipient_restrictions = check_recipient_access hash : / etc / postfix / recipient_access
( make sure these are the FIRST entry on the lines )
# /etc/init.d/postfix restart
Categories: How-To's , Technology Tags: Block , CentOS , Email , howto , PostFix , Receiver , Reject , Sender , Spam , tips
| 2 comments
Author:
erics , December 17th, 2010
Edit /etc/postfix/access and add entries like: baduser@baddomain.com 550 No such user here Then run the following command: postmap /etc/postfix/access Edit /etc/postfix/main.cf: smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access, {any other options already there…} Then run the following command: postfix reload
Categories: How-To's , Technology Tags: Access , Email , main.cf , PostFix , Postmap , postmap access , Reject , Reject Email
| No comments