I want to block all email sent to a certain domain, but allow emails to a few users in that domain. For example I want user1@domain.com user4@domain.com to be able to recieve emails, but no other users withing the @domain.com. How would I do this with header_checks?
This is what I have, but everything gets discarded.
/^To: user1@domain.com/ PASS
/^To: .*@domain.com.*/ DISCARD
header_checks postfix help!
Re: header_checks postfix help!
"PASS" isn't a valid action for the version of Postfix that comes with CentOS 6 (and 7)
-
- Posts: 135
- Joined: 2014/06/17 21:50:37
Re: header_checks postfix help!
Try using something like this in smtpd_recipient_restrictions of main.cf
access_list:
user@drop-this.com will be tried ahead of @drop-this
Code: Select all
smtpd_recipient_restrictions
check_recipient_access pcre:/etc/postfix/access_list
reject_unauth_pipelining,
permit_mynetworks
Code: Select all
/\@drop-this.com/ DISCARD
/foo\@drop-this.com/ OK
/bar\@drop-this.com/ OK