You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Jason Clark <je...@gmail.com> on 2005/07/05 22:27:25 UTC

HasMailAttributeWithValueRegex Issue...

Hello All,

quick question regarding : HasMailAttributeWithValueRegex

I'm writing a quick little handler to delete all mail with "out of office" 
in the subject line, but I can't seem to get this Matcher to work.

below is the line out of my config.xml

<mailet match="HasMailAttributeWithValueRegex=Subject,/.*office.*/i" 
class="Null" />

Am I using this Matcher wrong? 

Cheers,
jason.

Re: HasMailAttributeWithValueRegex Issue...

Posted by Stefano Bagnara <ap...@bago.org>.
> Hello All,
> 
> quick question regarding : HasMailAttributeWithValueRegex
> 
> I'm writing a quick little handler to delete all mail with 
> "out of office" 
> in the subject line, but I can't seem to get this Matcher to work.
> 
> below is the line out of my config.xml
> 
> <mailet match="HasMailAttributeWithValueRegex=Subject,/.*office.*/i" 
> class="Null" />
> 
> Am I using this Matcher wrong? 

Mail Attributes are Mailet context specific attributes and not mail headers.

You should use "SubjectIs" or "SubjectStartsWith" or if you need a pattern
matching you can write your own looking at SubjectIs for the header matching
and HasMailAttributeWithValueRegex for the regex matching code.

IMHO you should not delete all mails with "office" in the subject: too
dangerous.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org