Filtering Spam

Hello,

I’m sure this question has been asked before, so please feel free to
direct me to a place where I can find an answer.

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.

Thank you very much for your time.

Matthew Ekstrand-Abueg
Systems Administrator
Network Infrastructure, RSSP-IT
UC Berkeley

signature.asc (189 Bytes)

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