procmail
[Top] [All Lists]

Re: regex problem with '*'

2000-02-17 07:43:54
michael(_dot_)renner(_at_)gmx(_dot_)de writes:
Hi,
i used the following rule:
:0
* ^Subject[: ] ADV*
$MUELL 
to move marked SPAM to my trash folder ($MUELL).

I thought that every mail, having a subject
starting with ADV, would be moved to the trash.

Unfortunately, mails with Subject like 'ADMIN'
are trashed to :-(

 '*' in regular expressions means: zero or more of the previous
 character or group. So, ADV* matches subject lines with AD, ADV, ADVV ...

 It should work as intended if you leave out the asterisk.

 Also, the condition line should be

* ^Subject:[    ]*ADV

 with a space and a tab between the brackets.

 Third, for file delivery you also need a local lockfile, ie. a colon
 after the "0".

:0:
* ^Subject:[    ]*ADV
$MUELLTONNE

<Prev in Thread] Current Thread [Next in Thread>