You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2005/03/18 03:55:49 UTC

svn commit: r158011 - in spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm PerMsgLearner.pm

Author: dos
Date: Thu Mar 17 18:55:47 2005
New Revision: 158011

URL: http://svn.apache.org/viewcvs?view=rev&rev=158011
Log:
bug 4096: add conf option for exisitng code & modify code to use {conf} rather than {main}

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
    spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm?view=diff&r1=158010&r2=158011
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm Thu Mar 17 18:55:47 2005
@@ -1338,6 +1338,19 @@
     type => $CONF_TYPE_BOOL
   });
 
+=item learn_with_whitelist		(Default: 0)
+
+If this option is set the AWL database will also be affected when a message
+is learned by the bayes database, due to an autolearn or a call to sa-learn.
+
+=cut
+
+  push (@cmds, {
+    setting => 'learn_with_whitelist',
+    default => 0,
+    type => $CONF_TYPE_BOOL
+  });
+
 =item bayes_sql_override_username
 
 Used by BayesStore::SQL storage implementation.

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm?view=diff&r1=158010&r2=158011
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm Thu Mar 17 18:55:47 2005
@@ -99,7 +99,7 @@
 sub learn_spam {
   my ($self, $id) = @_;
 
-  if ($self->{main}->{learn_with_whitelist}) {
+  if ($self->{conf}->{learn_with_whitelist}) {
     $self->{main}->add_all_addresses_to_blacklist ($self->{msg});
   }
 
@@ -125,7 +125,7 @@
 sub learn_ham {
   my ($self, $id) = @_;
 
-  if ($self->{main}->{learn_with_whitelist}) {
+  if ($self->{conf}->{learn_with_whitelist}) {
     $self->{main}->add_all_addresses_to_whitelist ($self->{msg});
   }
 
@@ -148,7 +148,7 @@
 sub forget {
   my ($self, $id) = @_;
 
-  if ($self->{main}->{learn_with_whitelist}) {
+  if ($self->{conf}->{learn_with_whitelist}) {
     $self->{main}->remove_all_addresses_from_whitelist ($self->{msg});
   }
 



Re: svn commit: r158011 - in spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm PerMsgLearner.pm

Posted by Daniel Quinlan <qu...@pathname.com>.
"Daryl C. W. O'Shea" <sp...@dostech.ca> writes:

> Should I remove this from trunk?  I'm indifferent on the option... I 
> just saw the open bug and finished the code someone at one time 
> apparently thought was a good idea.

Well, my inclination would be to revert unless we're sure about the
destination location.  I'm -0.7 for now.

Daniel

-- 
Daniel Quinlan
http://www.pathname.com/~quinlan/

Re: svn commit: r158011 - in spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm PerMsgLearner.pm

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
Daniel Quinlan wrote:
> Hmmm... I'm not sure this fits in with the plugin model for AWL.  I
> talked with Michael about it a bit and we were unable to draw any
> conclusion, though.  I think we might want to think about it a bit more
> before we add this option, though.  Options are hard to kill off.
> 
> Daniel
> 
> dos@apache.org writes:
> 
> 
>>Author: dos
>>Date: Thu Mar 17 18:55:47 2005
>>New Revision: 158011
>>
>>URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D158011
>>Log:
>>bug 4096: add conf option for exisitng code & modify code to use {conf} rat=
>>her than {main}
>>
>>Modified:
>>    spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
>>    spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm
> 
> 

Should I remove this from trunk?  I'm indifferent on the option... I 
just saw the open bug and finished the code someone at one time 
apparently thought was a good idea.

Daryl


Re: svn commit: r158011 - in spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm PerMsgLearner.pm

Posted by Daniel Quinlan <qu...@pathname.com>.
Hmmm... I'm not sure this fits in with the plugin model for AWL.  I
talked with Michael about it a bit and we were unable to draw any
conclusion, though.  I think we might want to think about it a bit more
before we add this option, though.  Options are hard to kill off.

Daniel

dos@apache.org writes:

> Author: dos
> Date: Thu Mar 17 18:55:47 2005
> New Revision: 158011
> 
> URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D158011
> Log:
> bug 4096: add conf option for exisitng code & modify code to use {conf} rat=
> her than {main}
> 
> Modified:
>     spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
>     spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm

-- 
Daniel Quinlan
http://www.pathname.com/~quinlan/

Re: svn commit: r158011 - in spamassassin/trunk/lib/Mail/SpamAssassin: Conf.pm PerMsgLearner.pm

Posted by Daniel Quinlan <qu...@pathname.com>.
Hmmm... I'm not sure this fits in with the plugin model for AWL.  I
talked with Michael about it a bit and we were unable to draw any
conclusion, though.  I think we might want to think about it a bit more
before we add this option, though.  Options are hard to kill off.

Daniel

dos@apache.org writes:

> Author: dos
> Date: Thu Mar 17 18:55:47 2005
> New Revision: 158011
> 
> URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D158011
> Log:
> bug 4096: add conf option for exisitng code & modify code to use {conf} rat=
> her than {main}
> 
> Modified:
>     spamassassin/trunk/lib/Mail/SpamAssassin/Conf.pm
>     spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgLearner.pm

-- 
Daniel Quinlan
http://www.pathname.com/~quinlan/