Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: <test@example.com> To: <new@example.com> Date: Sun, 3 Feb 2013 08:19:34 +0100 Subject: Open your $Bank account –  ppnair Feb 22 '13 at 6:10

1 Answer 1

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 ..it working.. –  ppnair Feb 22 '13 at 11:02

Your Answer

 
discard

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.