explaining Bogofilter simply
David Relson
relson at osagesoftware.com
Sun Jan 25 21:20:59 CET 2004
On Sun, 25 Jan 2004 21:11:03 +0100
Andreas Pardeike wrote:
> On 2004-01-25, at 19.05, David Relson wrote:
>
> > That's how to get the score of a message line. The "-H", for
> > suppressing header tags, is crucial in this case.
>
> But isn't the result below contrary to this statement?
>
> > shell> echo "Buy Viagra for free" | bogofilter -H -vvv
> > X-Bogosity: Yes, tests=bogofilter, spamicity=0.970665,
> > version=0.16.0
> > n pgood pbad fw
> > U
> > "head:for" 779 0.044110 0.042813 0.492547
> > -"head:Buy" 0 0.000000 0.000000
> > 0.677171 +"head:Viagra" 0 0.000000 0.000000
> > 0.677171 +
> > "head:free" 1 0.000000 0.000113 0.996804
> > + N_P_Q_S_s_x_md 3 1.37e-02 9.55e-01
> > 9.71e-01
> > 1.00e-02 6.77e-01 0.100
>
> > shell> echo "\r\n\r\nBuy Viagra for free" | bogofilter -H -vvv
> > X-Bogosity: No, tests=bogofilter, spamicity=0.701919, version=0.16.0
> > n pgood pbad fw
> > U
> > "for" 9457 0.719393 0.330351 0.314697
> > +"free" 1017 0.071059 0.042016
> > 0.371578 +"Viagra" 586 0.011330 0.054700
> > 0.828410 +
> > "Buy" 331 0.005940 0.031370 0.840791
> > + N_P_Q_S_s_x_md 4 3.52e-01 7.56e-01
> > 7.02e-01
> > 1.00e-02 6.77e-01 0.100
>
> ???
>
> Andreas Pardeike
Andreas,
You're right! '-H' is broken in the bogofilter version you're using.
The flag's sense (true/false meaning) is wrong in 0.16 releases before
0.16.2.
Here's the patch:
Modified Files:
bogoconfig.c bogolexer.c
Log Message:
Have -H disable header_line_markup.
Index: bogoconfig.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/bogoconfig.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- bogoconfig.c 9 Jan 2004 12:42:21 -0000 1.131
+++ bogoconfig.c 9 Jan 2004 12:43:30 -0000 1.132
@@ -349,6 +349,9 @@
"\t -c file - read specified config file.\n"
"\t -C - don't read standard config files.\n"
"\t -d path - specify directory for wordlists.\n"
+#ifndef ENABLE_DEPRECATED_CODE
+ "\t -H - disables header line tagging.\n"
+#endif
"\t -k size - set BerkeleyDB cache size (MB).\n"
#ifdef ENABLE_DEPRECATED_CODE
"\t -W - use combined wordlist for spam and ham
tokens.\n"
@@ -660,7 +663,7 @@
#ifdef ENABLE_DEPRECATED_CODE
header_degen = true;
#else
- header_line_markup = true;
+ header_line_markup = false;
#endif
break;
Index: bogolexer.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/bogolexer.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- bogolexer.c 9 Jan 2004 12:42:21 -0000 1.55
+++ bogolexer.c 9 Jan 2004 12:43:30 -0000 1.56
@@ -81,6 +81,9 @@
"\t-v\t- set verbosity level.\n"
"\t-c file\t- read specified config file.\n"
"\t-C\t- don't read standard config files.\n"
+#ifndef ENABLE_DEPRECATED_CODE
+ "\t-H\t- disables header line tagging.\n"
+#endif
"\t-I file\t- read message from file instead of stdin.\n"
"\t-x list\t- set debug flags.\n"
"\t-D\t- direct debug output to stdout.\n");
@@ -119,7 +122,7 @@
}
#ifndef ENABLE_DEPRECATED_CODE
-#define OPTIONS ":c:CDhI:npP:qvVx:X:m"
+#define OPTIONS ":c:CDhHI:npP:qvVx:X:m"
#else
#define OPTIONS ":c:CDhHI:npP:qvVx:X:m"
#endif
@@ -169,9 +172,9 @@
help();
exit(EX_OK);
-#ifdef ENABLE_DEPRECATED_CODE
+#ifndef ENABLE_DEPRECATED_CODE
case 'H':
- header_degen = true;
+ header_line_markup = false;
break;
#endif
More information about the Bogofilter
mailing list