You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2007/11/16 11:33:55 UTC

Re: Force plugins order

Olivier Nicole writes:
> Hello,
> 
> Is there a way to force the order that SA will try the various plugins?
> 
> Typically I would have:
> 
> - a first plugin that analyzes PDF attachment, pushed the text part
>   back as text (post_message_parse) and the images as new message
>   parts (add_body_part);
> 
> - a second plugin that does OCR of the images attachments and pushes
>   the discovered text back as text (post_message_parse).
> 
> Obviously the first plugin should come first as it may discover images
> that will be OCRed by the second plugin.
> 
> How to force the order of the plugins?

see Mail::SpamAssassin::Plugin::register_method_priority --


    $plugin->register_method_priority($methodname, $priority)
        Indicate that the method named $methodname on the current object has a
        callback priority of $priority.

        This is used by the plugin handler to determine the relative order of
        callbacks; plugins with lower-numbered priorities are called before
        plugins with higher-numbered priorities.  Each method can have a dif-
        ferent priority value.  The default value is 0.  The ordering of call-
        backs to methods with equal priority is undefined.

        Typically, you only need to worry about this if you need to ensure your
        plugin's method is called before another plugin's implementation of
        that method.  It should be called from your plugin's constructor.

        This API was added in SpamAssassin 3.2.0.


--j.