You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by jdow <jd...@earthlink.net> on 2006/08/27 04:14:18 UTC

Suggestion - or am I off in the ozone

Managing local plugins is getting to be a minor hassle. What I've done
is create a subdirectory /etc/mail/spamassassin/local_plugins. This
works and minimizes clutter.

I've also noticed that maintaining load_plugin in a separate file
than the plugin's .cf files is also a hassle. Is there some magic
to the .pre files that makes it important to have the load_plugins
there? If not is there any magic to the order in which they might
be loaded if the load_plugin is simply in with the .cf file for
the plugin? Testing seems to indicate there is no order magic here.

So I'd like to also propose adding a PL_ prefix to the plugin .cf
files more as a convenience than a standard.

As a result we'd have PL_foo.cf containing the load_plugin statement
and the other .cf file statements for the plugin foo.pm, which would
itself exist as /etc/mail/spamassassin/local_plugins/foo.pm.

{^_^}

Re: Suggestion - or am I off in the ozone

Posted by jdow <jd...@earthlink.net>.
From: "Logan Shaw" <ls...@emitinc.com>

> From: "Theo Van Dinter" <fe...@apache.org>
>> On Sat, Aug 26, 2006 at 07:14:18PM -0700, jdow wrote:
>>> Is there some magic to the .pre files that makes it important to have
>>> the load_plugins there?
>>
>> Yes, pre files are loaded before anything else, so the plugins loaded from
>> there can be used in all cf files.
> 
> On Sat, 26 Aug 2006, jdow wrote:
>> <<jdow>> That suggests a 00_ prefix for local plugins would be
>> sufficient to cause them to be loaded before other custom plugins.
> 
> It's Monday morning so maybe my brain is in a fog, but
> doesn't SpamAssassin process everything in one directory in
> lexicographical order, then move on to the next dir?  If so,
> the 00_ trick would only be enough to order things within one
> directory and thus wouldn't be sufficient for foo.pre in dir2
> to go before bar.cf in dir1.
> 
> As I understand it, SpamAssassin solves this problem by doing
> one pass through all dirs for *.pre then another pass through
> all dirs for *.cf.  So unless SpamAssassin is updated to merge
> the contents of all dirs, then do a lexicographical pass of
> the merged set, the 00_ trick won't work.

/etc/mail/spamassassin is the first director considered to be
user customizable in the scan path. If SpamAssassin were to loop
for foo.pm support before that point it'd be doing a bad thing.
And indeed a name of ___foo.cf might be in order to make sure
it is REALLY the first thing. And any LATER directories, like
~/.spamassassin/user_prefs would be able to use items from
foo.pm.

{^_^}

Re: Suggestion - or am I off in the ozone

Posted by Logan Shaw <ls...@emitinc.com>.
From: "Theo Van Dinter" <fe...@apache.org>
> On Sat, Aug 26, 2006 at 07:14:18PM -0700, jdow wrote:
>> Is there some magic to the .pre files that makes it important to have
>> the load_plugins there?
>
> Yes, pre files are loaded before anything else, so the plugins loaded from
> there can be used in all cf files.

On Sat, 26 Aug 2006, jdow wrote:
> <<jdow>> That suggests a 00_ prefix for local plugins would be
> sufficient to cause them to be loaded before other custom plugins.

It's Monday morning so maybe my brain is in a fog, but
doesn't SpamAssassin process everything in one directory in
lexicographical order, then move on to the next dir?  If so,
the 00_ trick would only be enough to order things within one
directory and thus wouldn't be sufficient for foo.pre in dir2
to go before bar.cf in dir1.

As I understand it, SpamAssassin solves this problem by doing
one pass through all dirs for *.pre then another pass through
all dirs for *.cf.  So unless SpamAssassin is updated to merge
the contents of all dirs, then do a lexicographical pass of
the merged set, the 00_ trick won't work.

   - Logan

Re: Suggestion - or am I off in the ozone

Posted by jdow <jd...@earthlink.net>.
From: "Theo Van Dinter" <fe...@apache.org>

On Sat, Aug 26, 2006 at 07:14:18PM -0700, jdow wrote:
> Is there some magic to the .pre files that makes it important to have
> the load_plugins there?

Yes, pre files are loaded before anything else, so the plugins loaded from
there can be used in all cf files.

<<jdow>> That suggests a 00_ prefix for local plugins would be
sufficient to cause them to be loaded before other custom plugins.
If "foo.pm" is a local plugin there is no reason to presume that
any native rules would address it. (And for that matter rather
few other rule sets would likely address it. But 00_ should take
care of that issue.) Once something is distributed WITH SpamAssassin
then it ought to go into a .pre file. Until then SpamAssassin default
rule sets should not address it nor presume it is there.

I do NOT like including local modules in the perl5 path SpamAssassin
directory tree. That gets updated and the modules would potentially
get lost or overwritten, which is worse. That's why I suggested the
local_plugin directory.

{^_^}


Re: Suggestion - or am I off in the ozone

Posted by Theo Van Dinter <fe...@apache.org>.
On Sat, Aug 26, 2006 at 07:14:18PM -0700, jdow wrote:
> Is there some magic to the .pre files that makes it important to have
> the load_plugins there?

Yes, pre files are loaded before anything else, so the plugins loaded from
there can be used in all cf files.

-- 
Randomly Generated Tagline:
"Johnie Cochran abused Ito like a substitute teacher."   - Dennis Miller