[Rt-devel] Filtering Spam

Kevin Falcone falcone at bestpractical.com
Thu Jun 14 11:01:32 EDT 2007


On Jun 14, 2007, at 12:58 AM, Matthew Ekstrand-Abueg wrote:
> I have SpamAssassin running to flag all emails before they reach  
> RT, and
> would like to be able to filter the Spam messages (i.e. matching the
> header "X-Spam-Flag: Yes") to a Queue called "Spam" from a Scrip  
> within RT.
>
> My problem is simply that I can not figure out how to extract that
> portion of the header to place it within my scrip.  I am using RT
> version 3.6.3 should this make any difference.

Attachment objects have a GetHeader method so you can say
$attachment->GetHeader('X-Spam-Flag') and it will return the value.

You may want to take a look at the RT-Extension-ExtractCustomFieldValues
code on CPAN or on the wiki.  It has code you can steal.

-kevin


More information about the Rt-devel mailing list