https://rt-wiki.bestpractical.com/index.php?title=SpamScore2Priority&feed=atom&action=historySpamScore2Priority - Revision history2024-03-29T13:11:25ZRevision history for this page on the wikiMediaWiki 1.37.2https://rt-wiki.bestpractical.com/index.php?title=SpamScore2Priority&diff=3687&oldid=prevAdmin: 2 revisions imported2016-04-06T20:37:47Z<p>2 revisions imported</p>
<p><b>New page</b></p><div>Unfortunately, RT hides a lot of message headers from the basic user interface, and so reviewing the few suspected spam messages that leak into your system can be rather tedious. Fortunately, you can use this scrip to alleviate some of this pain. The scrip below (currently setup for SpamAssassin style headers) will store an incoming email message's spam score as the ticket's initial priority. Thus a very spammy message might have a priority of -15, and questionable message might have a priorirty of -1; the system automagically handles any necessary casting. you can then occasionally review your Spam queue, sorting the messages by priority and paying the most attention to those with scores near zero.<br />
<br />
* Queue: Spam<br />
* Description: Spam score to negative priority<br />
* Condition: On Create<br />
* Action: User Defined<br />
* Template: Global: Blank<br />
* Stage: [[TransactionCreate]]<br />
<br />
my $score = $self-&gt;TransactionObj-&gt;Attachments-&gt;First-&gt;GetHeader('X-Spam-Score');<br />
unless( $score ){<br />
my $t = $self-&gt;TransactionObj-&gt;Attachments-&gt;First-&gt;GetHeader('X-Spam-Status');<br />
$t =~ /score=(-?\d+(|:\.\d+)?)/ &amp;&amp; ($score = $1);<br />
}<br />
$self-&gt;TicketObj-&gt;SetPriority( -$score ) if $score;</div>Admin