• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 449
  • Last Modified:

header_checks

I'm using Postfix 2.7 and I'm trying to setup some header filters.
In main.cf I'm using regexp, not pcre.
header_checks entry:
/^Subject: .*Money/ REJECT
Which rejects an email with the word money in the subjectline. Now what if you want to reject the message if it does _not_ contain the word money? By documentation a prefix exclamation should do it:
!/^Subject: .*Money/ REJECT
but it doesn't work!!
0
clark42
Asked:
clark42
  • 2
1 Solution
 
bevhostCommented:
I have tried this, but... I would expect the the line

!/^Subject: .*Money/ REJECT

should reject all emails, since all emails will contain a header line which does not match that string.
Is that what you are seeing?

Can you try this...

if /^Subject:/
!/^Subject: .*Money/ REJECT
endif
0
 
bevhostCommented:
oops typo.... I have NOT tried this..
0
 
clark42Author Commented:
Thanks - that's exactly what I was looking for!! :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now