Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Postfix regexp is not working when I use this:

/^Subject:Open your $Bank account  /                REJECT

But when I use like below Subject it is working:

/^Subject:.*($Bank|account) /                    REJECT

How do I match the exact Subject using regexp?

share|improve this question
Please provide the exact header you're trying to match, otherwise we're just guessing what it looks like. – mgorven Feb 22 '13 at 5:39
From: <> To: <> Date: Sun, 3 Feb 2013 08:19:34 +0100 Subject: Open your $Bank account – ppnair Feb 22 '13 at 6:10
up vote 0 down vote accepted

There's a space after Subject: which your regex is missing.

/^Subject: Open your $Bank account/                REJECT

Note there are also spaces at the end of your regex which I removed from the one above.

share|improve this answer
thank you working.. – ppnair Feb 22 '13 at 11:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.