You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by Apache Wiki <wi...@apache.org> on 2007/05/08 13:41:15 UTC

[Spamassassin Wiki] Update of "PluginWritingTips" by JustinMason

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Spamassassin Wiki" for change notification.

The following page has been changed by JustinMason:
http://wiki.apache.org/spamassassin/PluginWritingTips

The comment on the change is:
hmm, add some comments noting that these tricks are unsupported

------------------------------------------------------------------------------
  
  And thats it. The {{{ got_hit ($rule, $area, %params) }}} call will trigger a hit for the specified rule with the specified score. Area means for example BODY or HEADER, so this has to be changed according to what you are doing. (See [http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_PerMsgStatus.html Mail::SpamAssassin::PerMsgStatus] for other possible params.)
  
- The rule description is accessible with {{{ $pms->{conf}->{descriptions}->{EXAMPLE_RULE_NAME} }}}. It is usually set by {{{ describe EXAMPLE_RULE_NAME }}} in the rules file but can also be changed at runtime.
- 
- Setting {{{ $pms->{conf}->{scoreset}->[$set]->{"EXAMPLE_RULE_NAME"} }}} lets the dynamic score appear in the template tag _TESTSSCORES_, which might be used for the X-Spam-Status line. (The for loop is necessary to set all 4 values, for their explanation see [http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html Mail::SpamAssassin::Conf] item {{{score SYMBOLIC_TEST_NAME n.nn}}} )
- 
  The {{{ return 0; }}} is important because that will make sure that the actual rule that we defined earlier with the {{{ eval:check_example() }}} never evaluates to true so it doesn't score. It doesn't need to score because the actual scoring is completely being done inside the subroutine. So even if you defined a score in the configuration file earlier, it would never be used.
  
+ The rule description is accessible with {{{ $pms->{conf}->{descriptions}->{EXAMPLE_RULE_NAME} }}}. It is usually set by {{{ describe EXAMPLE_RULE_NAME }}} in the rules file but can also be changed at runtime.  (actually, changing this at runtime is not recommended and may not be supported in future versions; I'm not sure it even works in SA 3.2.0. if you want to do something similar, it would be better to open an enhancement request on our bugzilla so we can come up with a proper API. --jm)
+ 
+ Setting {{{ $pms->{conf}->{scoreset}->[$set]->{"EXAMPLE_RULE_NAME"} }}} lets the dynamic score appear in the template tag _TESTSSCORES_, which might be used for the X-Spam-Status line. (The for loop is necessary to set all 4 values, for their explanation see [http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html Mail::SpamAssassin::Conf] item {{{score SYMBOLIC_TEST_NAME n.nn}}} )  (again, changing the {scoreset} values is not recommended and probably will not work in future versions!  please talk about this via the bugzilla. --jm)
+