Re: [Evolution-hackers] SpamBayes

2007-07-27 Thread Rasmus Toftdahl Olesen
man, 23 07 2007 kl. 01:30 -0600, skrev Sankar P:
Sorry for the slow answer, vacation time :-)

 On Fri, 2007-07-20 at 18:17 +0200, Rasmus Toftdahl Olesen wrote:
  Hi There
  
  I am the author of the SpamBayes using spam filtering plugin for
  Evolution, so far i seem to have things working nicely (i based my code
  on the Bogofilter plugin).
  
  But there is one thing i am missing, i would like to be able to track
  which messages have been marked as what - in SpamBayes you need to
  untrain a wrongly tagged message before you can train on it tagged the
  right way.
  
  In other words, a message can have three states: not rated, junk or
  not-junk. If the user wishes to train a message as e.g. junk i need to
  know if it has previously been trained as not-junk (so i can untrain it)
  before i train it as junk.
  
  Rather than maintaining a database of seen messages on my own, i
  thought it would be nice (as well as a good debugging feature) to be
  able to add a custom header (X-Evolution-Spambayes-Plugin) to each
  message as it is seen by the SpamBayes plugin, this would allow me to
  see whether the message is new or not.
  
  Is this possible?
 
 Try using camel_medium_add_header. Attached is a patch. Verify.
I tried using camel_medium_add_header instead, but from what i can
gather, camel_medium_set_header does that automatically if the header
doesn't exist already.

 Your plugin needs to be improved a little more. The bazaar sources link
 leads to an empty page. If I download the source tarball, it does not
 have configure.in so I can't run autogen. I needed that because your
 configure script had 2.10 hard-coded. Trunk is 2.11.*
The newer autoconf uses configure.ac instead of configure.in - so that
is what i am shipping instead. But anyway, is there something i can add
to the PKG_CHECK_MODULES call in configure.ac to ask for
evolution-plugin = 2.10 ? As i see it i have to depend on a specific
version since the pkg-config name is evolution-plugin-2.10.

The bazaar link should be working ok, it's just that bazaar sources are
stored in a .bzr subfolder - the bzr client knows what to do ;-)

-- 
Rasmus Toftdahl Olesen [EMAIL PROTECTED]
halfdans.net

___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] SpamBayes

2007-07-23 Thread Sankar P
On Fri, 2007-07-20 at 18:17 +0200, Rasmus Toftdahl Olesen wrote:
 Hi There
 
 I am the author of the SpamBayes using spam filtering plugin for
 Evolution, so far i seem to have things working nicely (i based my code
 on the Bogofilter plugin).
 
 But there is one thing i am missing, i would like to be able to track
 which messages have been marked as what - in SpamBayes you need to
 untrain a wrongly tagged message before you can train on it tagged the
 right way.
 
 In other words, a message can have three states: not rated, junk or
 not-junk. If the user wishes to train a message as e.g. junk i need to
 know if it has previously been trained as not-junk (so i can untrain it)
 before i train it as junk.
 
 Rather than maintaining a database of seen messages on my own, i
 thought it would be nice (as well as a good debugging feature) to be
 able to add a custom header (X-Evolution-Spambayes-Plugin) to each
 message as it is seen by the SpamBayes plugin, this would allow me to
 see whether the message is new or not.
 
 Is this possible?

Try using camel_medium_add_header. Attached is a patch. Verify.

Your plugin needs to be improved a little more. The bazaar sources link
leads to an empty page. If I download the source tarball, it does not
have configure.in so I can't run autogen. I needed that because your
configure script had 2.10 hard-coded. Trunk is 2.11.*

 
 I have tried using camel_medium_set_header and camel_medium_get_header
 on the CamelMimeMessage passed to the junk, non-junk hooks, but that
 doesn't seem to work - but doesn't crash Evolution either.
 
 Thanks for any insight you can provide.
 
 My plugin is available form here:
 http://halfdans.net/wiki.py/EvolutionSpamBayesPlugin
 
-- 
Sankar

 Novell, Inc. 
Software for the Open Enterpriseā„¢
http://www.novell.com
--- sb-junk-filter.c2007-07-23 12:49:45.0 +0530
+++ sb-junk-filter.c.vcs2007-07-23 12:32:02.0 +0530
@@ -302,7 +302,7 @@ void em_junk_sb_report_junk (EPlugin *ep
 if ( header  strcmp(header, PLUGIN_HEADER_HAM) == 0 ) {
 em_junk_sb_report_non_junk_untrain ( msg );
 }
-camel_medium_add_header ( CAMEL_MEDIUM(msg), PLUGIN_HEADER, 
PLUGIN_HEADER_SPAM );
+camel_medium_set_header ( CAMEL_MEDIUM(msg), PLUGIN_HEADER, 
PLUGIN_HEADER_SPAM );
 
 gchar *argv[] = {
 SPAMBAYES_CLIENT_BINARY,
@@ -327,7 +327,7 @@ void em_junk_sb_report_non_junk (EPlugin
 if ( header  strcmp(header, PLUGIN_HEADER_SPAM) == 0 ) {
 em_junk_sb_report_junk_untrain ( msg );
 }
-camel_medium_add_header ( CAMEL_MEDIUM(msg), PLUGIN_HEADER, 
PLUGIN_HEADER_HAM );
+camel_medium_set_header ( CAMEL_MEDIUM(msg), PLUGIN_HEADER, 
PLUGIN_HEADER_HAM );
 
 gchar *argv[] = {
 SPAMBAYES_CLIENT_BINARY,
___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers