Re: [Mimedefang] Correction about Autolearn Headers
Kelson, I've looked at the 2.63 source code and MD 2.42 source about this and I think the auto_learn information *is* available though not documented. The changes I think are required are basically this: 1. do not use the spam_assassin_check built into MD. 2. make your own spam_assassin_check that checks the permsgstatus object and builds the autolearn information here's my first (untested) pass at the problem (http://www.peregrinehw.com/downloads/MIMEDefang/contrib/autolearn_info): sub my_spam_assassin_check (;$) { my($status) = spam_assassin_status(@_); return undef if (!defined($status)); my $hits = $status->get_hits; my $req = $status->get_required_hits(); my $tests = $status->get_names_of_tests_hit(); my $report = $status->get_report(); my $autolearn = ""; #Check if Bayesian is Turned On, If AutoTesting is Turned On, or if AutoLearning is turned off #I believe $SASpamTester will have this info and will be in scope if called from filter_end. if (($SASpamTester->{conf}->{bayes_auto_learn}) and ($SASpamTester->{conf}->{use_bayes}) and (!$SASpamTester->{disable_auto_learning})) { if (!defined($status->{auto_learn_status})) { $autolearn="no"; } elsif ($spamstatus->{auto_learn_status}) { $autolearn="spam"; } else { $autolearn = "ham"; } } $status->finish(); return ($hits, $req, $tests, $report, $autolearn); } I then have a build_status_line function that I would pass the extra autolearn information and add it to the header. (see build_status_line at the bottom http://www.peregrinehw.com/downloads/MIMEDefang/mimedefang-filter-KAM) Any comments? The check of the conf file above is not 100% needed so I think this will work since we have access to the PerMsgStatus handler prior to descoping it. Regards, KAM > >You can do this already; just call spam_assassin_status from your > >filter, and process the status object yourself. Heck, it's even > >documented in the mimedefang-filter man page. :-) > > This was possible in SA 2.5x - however, beginning with 2.60, the > SpamAssassin object no longer exposes the auto-learn results or the > function to build the status line. (It didn't technically expose either > before, but you could get the status line through an undocumented function > -- which no longer exists.) You can construct it from all the other > pieces, but auto-learn isn't available. ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Correction about Autolearn Headers
Gotcha. Forest for the trees. The wasted time from someone posting supposedly working code getting the auto_learn_status from $SASpamTester had me going 180 degrees the wrong way. > You can do this already; just call spam_assassin_status from your > filter, and process the status object yourself. Heck, it's even > documented in the mimedefang-filter man page. :-) ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Correction about Autolearn Headers
At 09:13 AM 6/1/2004, David F. Skoll wrote: On Tue, 1 Jun 2004, Kevin A. McGrail wrote: > Therefore, the only way to make this work that I can see is to modify > mimedefang.pl. It would be a simple change to return $status, comment out > the $status->finish, and return $status to the subfilter where you would > need to run a $status->finish on it in the subfilter. You can do this already; just call spam_assassin_status from your filter, and process the status object yourself. Heck, it's even documented in the mimedefang-filter man page. :-) This was possible in SA 2.5x - however, beginning with 2.60, the SpamAssassin object no longer exposes the auto-learn results or the function to build the status line. (It didn't technically expose either before, but you could get the status line through an undocumented function -- which no longer exists.) You can construct it from all the other pieces, but auto-learn isn't available. Kelson Vibber SpeedGate Communications ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Correction about Autolearn Headers
On Tue, 1 Jun 2004, Kevin A. McGrail wrote: > Therefore, the only way to make this work that I can see is to modify > mimedefang.pl. It would be a simple change to return $status, comment out > the $status->finish, and return $status to the subfilter where you would > need to run a $status->finish on it in the subfilter. You can do this already; just call spam_assassin_status from your filter, and process the status object yourself. Heck, it's even documented in the mimedefang-filter man page. :-) Regards, David. ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang