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

Re: svn commit: r501204 - in /spamassassin/trunk: lib/Mail/SpamAssassin/PerMsgStatus.pm t/check_implemented.t

Michael Parker writes:
> jm@apache.org wrote:
> > Author: jm
> > Date: Mon Jan 29 14:32:18 2007
> > New Revision: 501204
> > 
> > URL: http://svn.apache.org/viewvc?view=rev&rev=501204
> > Log:
> > bug 5311: die() if no plugin implements 'check_main' and the check() API is called, otherwise it's reasonably easy to wind up with a non-scanning scanner.  also, add a test
> > 
> > Added:
> >     spamassassin/trunk/t/check_implemented.t   (with props)
> > Modified:
> >     spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
> > 
> > Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
> > URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm?view=diff&rev=501204&r1=501203&r2=501204
> > ==============================================================================
> > --- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
> > +++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Mon Jan 29 14:32:18 2007
> > @@ -155,9 +155,14 @@
> >      $self->{conf}->set_score_set ($set|2);
> >    }
> >  
> > -  # The primary check functionality occurs via a plugin call.  For more information please
> > -  # see: Mail::SpamAssassin::Plugin::Check
> > +  # The primary check functionality occurs via a plugin call.  For more
> > +  # information, please see: Mail::SpamAssassin::Plugin::Check
> >    $self->{main}->call_plugins ("check_main", { permsgstatus => $self });
> > +
> > +  # did anything happen?  if not, this is fatal
> > +  if (!$self->{score} && !$self->{main}->have_plugin("check_main")) {
> > +    die "check: no loaded plugin implements 'check_main': cannot scan!";
> > +  }
> >  
> 
> I think I mentioned this before, but my idea here was to build it into
> call_plugins.  Have a param that said if something MUST implement the
> plugin call and die otherwise.

That's where we started, but not what we agreed, in the end... take a look
at http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5243 :

]------- Additional Comment #4 From Justin Mason  2006-12-15 08:17
]Michael: it looks like that can be done without adding a new API
]as follows.  [...]
]
]have_plugin() already exists.  I think I prefer the latter anyway, since
]it allows the caller to decide what action to take if 'check_main' is
]unimplemented by any plugin.
]
]given that, I'll mark this as FIXED; reopen if you'd prefer to see a new
]API instead.
]
]------- Additional Comment #5 From Michael Parker  2006-12-15 09:00
]Nah, that works for me, thanks.

;)

> I -.5 on adding another if check after the call here, it just
> slows things down.

I'll see if I can find a non-slow way.  should be easy enough.

--j.

Re: svn commit: r501204 - in /spamassassin/trunk: lib/Mail/SpamAssassin/PerMsgStatus.pm t/check_implemented.t

Posted by Michael Parker <pa...@pobox.com>.
Justin Mason wrote:
> Michael Parker writes:
>> I think I mentioned this before, but my idea here was to build it into
>> call_plugins.  Have a param that said if something MUST implement the
>> plugin call and die otherwise.
> 
> That's where we started, but not what we agreed, in the end... take a look
> at http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5243 :

/me sighs

toooooo busy....I'd forgotten about that.  I try to keep up, honest!

Ok, I like your solution BTW, so no problems.

Thanks
Michael