How to negate a string in Procmail regex?
am 16.08.2006 22:44:07 von Steve
I have reason to drop all undelivered not addressed to me by name, with
a specific list of subjects, so I tried the following recipe:
:0:
* ^X-Original-To: [^(me)]
* ^Subject: test
IN-testing
However, in the procmail log I see the error "Missing action", and
obviously the recipe doesn't work. If I change the 2nd line to:
* ^X-Original-To: (me)
....it matches everything addressed to 'me' as it should. What I want
to do is match everything *not* addressed to me. Can this be done?
Many thanks,
Steve :)
Re: How to negate a string in Procmail regex?
am 17.08.2006 06:21:30 von Garen Erdoisa
Steve wrote:
> I have reason to drop all undelivered not addressed to me by name, with
> a specific list of subjects, so I tried the following recipe:
>
> :0:
> * ^X-Original-To: [^(me)]
> * ^Subject: test
> IN-testing
>
> However, in the procmail log I see the error "Missing action", and
> obviously the recipe doesn't work. If I change the 2nd line to:
Try setting VERBOSE=yes and monitor the procmail log while testing. It
should help point out where the "Missing action" warning is being
triggered in your .procmailrc
The "missing action" indicates that procmail saw the beginning of a
recipe followed by zero or more tests, but no action, so procmail would
skip that recipe and report a warning about it in the log.
>
> * ^X-Original-To: (me)
Try:
* ! ^X-Original-To: (me)
An exclamation point in front of the test inverts the test.
>
> ...it matches everything addressed to 'me' as it should. What I want
> to do is match everything *not* addressed to me. Can this be done?
>
--
Regards
Garen