Page 1 of 1

header_checks postfix help!

Posted: 2018/07/10 18:55:27
by ant2ne
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

Re: header_checks postfix help!

Posted: 2018/07/11 04:58:23
by Whoever
"PASS" isn't a valid action for the version of Postfix that comes with CentOS 6 (and 7)

Re: header_checks postfix help!

Posted: 2018/07/12 18:27:35
by jscarville
Try using something like this in smtpd_recipient_restrictions of main.cf

Code: Select all

smtpd_recipient_restrictions
  check_recipient_access pcre:/etc/postfix/access_list
  reject_unauth_pipelining,
  permit_mynetworks
access_list:

Code: Select all

/\@drop-this.com/               DISCARD

/foo\@drop-this.com/            OK
/bar\@drop-this.com/            OK
user@drop-this.com will be tried ahead of @drop-this