header_checks postfix help!

Issues related to applications and software problems
Post Reply
ant2ne
Posts: 18
Joined: 2015/01/26 22:14:59

header_checks postfix help!

Post by ant2ne » 2018/07/10 18:55:27

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

Whoever
Posts: 1025
Joined: 2013/09/06 03:12:10

Re: header_checks postfix help!

Post by Whoever » 2018/07/11 04:58:23

"PASS" isn't a valid action for the version of Postfix that comes with CentOS 6 (and 7)

jscarville
Posts: 108
Joined: 2014/06/17 21:50:37

Re: header_checks postfix help!

Post by jscarville » 2018/07/12 18:27:35

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

Post Reply