[100867] in RedHat Linux List
Re: Re: procmail statement
daemon@ATHENA.MIT.EDU (Thomas Ribbrock \(Design/DEG\))
Mon Nov 23 15:27:34 1998
Date: Mon, 23 Nov 1998 20:24:24 +0000
From: "Thomas Ribbrock \(Design/DEG\)" <argathin@iname.com>
To: Red Hat Users List <redhat-list@redhat.com>
Mail-Followup-To: Red Hat Users List <redhat-list@redhat.com>
In-Reply-To: <Pine.LNX.4.05.9811231506050.4205-100000@winbuster.magic.fr>; from Zoki on Mon, Nov 23, 1998 at 03:33:04PM +0100
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Zoki writes:
> What I understand from all the replies is that the following statement in
> .procmailrc:
>
> ->* ^Subject: +test
>
> would filter a Subject saying "test" but *not* "testimony".
To the best of my knowledge: Wrong. The shortest possible match is taken (or
was it the longest?) Anyway, testimony is matched as well.
I just tried this rule:
* ^Subject:.*TRi-spamtest
with a subject "TRi-spamtest xxx" and it matched.
If you want to be sure only "test" is matched, you'd have to use:
* ^Subject: +test$
$ stands for end of line, so this rule would match the word test with one or
more spaces in front of it and nothing after it.
> BTW, shouldn't it be "test+" instead of "+test"? Man procmailrc shows the
> "+" after the word.
No. The + is related to the space in front of it (hence " test" is
valid). test+ would filter "test", "testt", "testtt", ...
The + means "one or more of the characters/expressions in front of the +".
See e.g. man procmailrc for more.
BTW: grep works in a very similar way. It all boils down to regular
expressions. The procmailex man page refers to the egrep man page as well.
HTH,
Thomas
--
"Look, Ma, no obsolete quotes and plain text only!"
Thomas Ribbrock | http://www.bigfoot.com/~kaytan | ICQ#: 15839919
"You have to live on the edge of reality - to make your dreams come true!"
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.