header_checks postfix help!

Issues related to applications and software problems
Post Reply
Posts: 23
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

Posts: 1122
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)

Posts: 126
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

  check_recipient_access pcre:/etc/postfix/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

Return to “CentOS 6 - Software Support”