From: yamaoka Date: Wed, 17 Nov 2004 23:40:23 +0000 (+0000) Subject: Synch to No Gnus 200411172019. X-Git-Tag: t-gnus-6_17_4-quimby-~672 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0e9377b1f8de519f2dc52846a7126663a3bc41db;p=elisp%2Fgnus.git- Synch to No Gnus 200411172019. --- diff --git a/texi/ChangeLog b/texi/ChangeLog index ee68133..4da4d18 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,20 @@ +2004-11-17 Teodor Zlatanov + + * gnus.texi: replaced @file{spam.el} with @code{spam.el} + everywhere for consistency. + (Filtering Spam Using The Spam ELisp Package): admonish again. + (Spam ELisp Package Sequence of Events): this is Gnus, say so. + Say "regular expression" instead of "regex." Admonish. Pick + other words to sound better (s/so/thus/). + (Spam ELisp Package Filtering of Incoming Mail): mention + statistical filters. Remove old TODO. + (Spam ELisp Package Sorting and Score Display in Summary Buffer): + new section on sorting and displaying the spam score + (BBDB Whitelists): mention spam-use-BBDB-exclusive is not a + backend but an alias to spam-use-BBDB + (Extending the Spam ELisp package): rewrite the example using the + new backend functionality. + 2004-11-16 Simon Josefsson * gnus.texi (NNTP): Mention nntp-marks-is-evil and diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index f38c2a8..b98597a 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -21657,14 +21657,17 @@ Gnus $B$O(B hashcash $B%/%C%-!<$rG'>Z$9$k$3$H$,$G$-$^$9$,!"A0$G$9!#(B -$BBh0l$K!"(B@code{spam.el} $B$r<+F0FI$_9~$_(B (autoload) $B$7$F(B @code{spam.el} $B$N(B -$B3F%U%C%/$r%$%s%9%H!<%k$9$k$?$a$K!"4X(B +@code{spam.el} $B%7!<%1%s%9$N%$%Y%s%H$N9`$r$A$c$s$HFI$_$^$7$g$&!#(B +@ref{Spam ELisp Package Sequence of Events} $B$r;2>H$7$F2<$5$$!#(B + +@code{spam.el} $B$r;H$&$K$O!"(B@code{spam.el} $B$r<+F0FI$_9~$_(B (autoload) $B$7(B +$B$F(B @code{spam.el} $B$N3F%U%C%/$r%$%s%9%H!<%k$9$k$?$a$K!"4X(B $B?t(B @code{spam-initialize} $B$r(B @strong{$B\:Y$O8e=R(B (@pxref{Spam ELisp +$B$j$^$9!#%7!<%1%s%9$N%$%Y%s%H$K$D$$$F$N>\:Y$O8e=R(B (@pxref{Spam ELisp Package Sequence of Events})$B!#(B $B0J2<$N%-!<%\!<%IL?Na$,;H$($k$h$&$K$J$j$^$9(B: @@ -21714,7 +21717,7 @@ Spam $B5-;v$r8+$?$H$-$O$$$D$G$b!"%0%k!<%W$rH4$1$kA0$KI,$:(B @kbd{M-d} $B$G$=$ @end table -$B$^$?!"(B@file{spam.el} $B$rFI$_9~$`$H!"$=$NJQ?t72$r%+%9%?%^%$%:$9$k$3$H$,$G(B +$B$^$?!"(B@code{spam.el} $B$rFI$_9~$`$H!"$=$NJQ?t72$r%+%9%?%^%$%:$9$k$3$H$,$G(B $B$-$k$h$&$K$J$j$^$9!#(B@samp{spam} $BJQ?t%0%k!<%W$K$D$$(B $B$F(B @code{customize-group} $B$r;n$7$F$_$F2<$5$$!#(B @@ -21722,6 +21725,7 @@ Spam $B5-;v$r8+$?$H$-$O$$$D$G$b!"%0%k!<%W$rH4$1$kA0$KI,$:(B @kbd{M-d} $B$G$=$ * Spam ELisp Package Sequence of Events:: * Spam ELisp Package Filtering of Incoming Mail:: * Spam ELisp Package Global Variables:: +* Spam ELisp Package Sorting and Score Display in Summary Buffer:: * Spam ELisp Package Configuration Examples:: * Blacklists and Whitelists:: * BBDB Whitelists:: @@ -21742,16 +21746,15 @@ Spam $B5-;v$r8+$?$H$-$O$$$D$G$b!"%0%k!<%W$rH4$1$kA0$KI,$:(B @kbd{M-d} $B$G$=$ @cindex spam filtering @cindex spam filtering sequence of events @cindex spam - $B$I$N$h$&$K(B @code{spam.el} $B$,F/$/$+$rM}2r$9$k$?$a$K!"I,$:$3$N9`$rFI$s$G2<(B $B$5$$!#FI$_Ht$P$7!"B.FI!"$^$?$Ol9g(B ($B$=$l$O%0%k!<%W(B/$B%H%T%C%/$K$D$$$F!"(B -$B$"$k$$$OI,MW$K1~$8$F==GD$R$H$+$i$2$K(B ON $B$K$G$-$^$9(B)$B!"$=$l$O%0%k!<%W$KF~(B -$B$k(B ($B$=$N%0%k!<%W$N35N,%P%C%U%!$K0\F0$9$k(B) $B=hM}$K$*$$$F/$J$j$H$b(B spam $B_I2a$N4IM}$r%f!<%6$K5v2D$7(B $B$^$9!#%f!<%6$O3F%0%k!<%W$N(B spam $B8!=P$Nl9g(B ($BNc$($P(B @acronym{NNTP} $B$N$h$&$JFI$_9~$_@lM @cindex spam filtering incoming mail @cindex spam -$BF~$C$F$/$k%a!<%k$r_I2a$9$kL\E*$G(B @file{spam.el} $B$r;H$&$K$O!"FC5iJ,3d%j%9(B +$BF~$C$F$/$k%a!<%k$r_I2a$9$kL\E*$G(B @code{spam.el} $B$r;H$&$K$O!"FC5iJ,3d%j%9(B $B%H(B @code{nnmail-split-fancy} $B$^$?$O(B @code{nnimap-split-fancy} $B$K0J2<$rDI(B $B2C$7$J$1$l$P$J$j$^$;$s(B: @@ -21924,7 +21929,7 @@ SpamAssassin $B%X%C%@!<$K(B ding $B$N5,B'$rCV$-49$($5$;$k$3$H$O$G$-$^$9$,!"B> $B8!::$HF1;~$KL@$i$+$K(B @code{spam-split} $B$rr7o(B $BIU$-$NFI$_9~$_$,9T$o$l$k$+$i$G$9!#(B @@ -21933,18 +21938,14 @@ SpamAssassin $B%X%C%@!<$K(B ding $B$N5,B'$rCV$-49$($5$;$k$3$H$O$G$-$^$9$,!"B> $B%X%C%@!<$@$1$G$O$J$/$F%a%C%;!<%8A4BN$K4p$E$$$FJ,3d$r9T$J$$$?$$>l9g$O!"%V!<(B $B%kJQ?t(B @code{nnimap-split-download-body} $B$,@_Dj$5$l$kI,MW$,$"$j$^$9!#%G%#(B $B%U%)%k%H$G$O!"(Bnnimap $B%P%C%/%(%s%I$O%a%C%;!<%8%X%C%@!<$@$1$rpJs(B -$B$rF@$k(B) $B$r;H$&$J$i$P!"$3$NJQ?t$r@_Dj$7$J$1$l$P$J$j$^$;$s!#$=$l(B -$B$O(B @acronym{IMAP} $B$NF0:n$rCY$/$7$F$7$^$$!"%f!<%6$rBeI=$9$k$N$K$U$5$o$7$$(B -$B7hDj$G$O$J$$$N$G!"%G%#%U%)%k%H$G$O@_Dj$5$l$F$$$^$;$s!#(B +$B$rF@$k(B) $B$N$h$&$J(B @emph{$BE}7WE*$J(B} $B_I2a4o$r;H$&$J$i$P!"$3$NJQ?t$O<+F0E*$K(B +$B@_Dj$5$l$k$G$7$g$&!#$=$l$O(B @acronym{IMAP} $B$NF0:n$rCY$/$7$F$7$^$&$N$G!"E}(B +$B7WE*$G$O$J$$%P%C%/%(%s%I$KBP$7$F%G%#%U%)%k%H$G$O@_Dj$5$l$F$$$^$;$s!#(B @xref{Splitting in IMAP}. -@emph{TODO: spam.el $B$O$9$Y$F$NE}7W%G!<%?%Y!<%9$r%H%l!<%K%s%0$9$k$?$a$N0l(B -$BDjITJQ$NJ}K!$rDs6!$9$kI,MW$,$"$j$^$9!#$$$/$D$+$O$=$N5!G=$r<+A0$G;}$C$F$$(B -$B$^$9$,!"$=$&$G$J$$$b$N$b$"$j$^$9!#(B} - @node Spam ELisp Package Global Variables @subsubsection Spam ELisp Package Global Variables @cindex spam filtering @@ -22119,6 +22120,56 @@ Ham $B$,(B spam $B%0%k!<%W$+$i0\F0$5$l$kA0$K0u$r>C$7$?$$>l9g$O!"$3$NJQ?t$r%;% $B$3$H$,L5$$5-;v$@$1!"$^$?$O$9$Y$F$NL$FI5-;v$N(B spam $B8!::$r9T$J$&$+$I$&$+$r(B $B;X<($7$^$9!#$3$l$O$=$N$^$^$K$7$F$*$/$3$H$r4+$a$^$9!#(B +@c TRANSLATEME +@node Spam ELisp Package Sorting and Score Display in Summary Buffer +@subsubsection Spam ELisp Package Sorting and Score Display in Summary Buffer +@cindex spam scoring +@cindex spam sorting +@cindex spam score summary buffer +@cindex spam sort summary buffer +@cindex spam + +You can display the spam score of articles in your summary buffer, and +you can sort articles by their spam score. + +First you need to decide which backend you will be using. If you use +the @code{spam-use-spamassassin}, +@code{spam-use-spamassassin-headers}, or @code{spam-use-regex-headers} +backend, the @code{X-Spam-Status} header will be used. If you use +@code{spam-use-bogofilter}, the @code{X-Bogosity} header will be used. +If you use @code{spam-use-crm114}, any header that matches the CRM114 +score format will be used. As long as you set the appropriate backend +variable to t @emph{before} you load @code{spam.el}, you will be +fine. @code{spam.el} will automatically add the right header to the +internal Gnus list of required headers. + +To show the spam score in your summary buffer, add this line to your +@code{gnus.el} file (note @code{spam.el} does not do that by default +so it won't override any existing @code{S} formats you may have). + +@lisp +(defalias 'gnus-user-format-function-S 'spam-user-format-function-S) +@end lisp + +Now just set your summary line format to use @code{%uS}. Here's an +example that formats the spam score in a 5-character field: + +@lisp +(setq gnus-summary-line-format + "%U%R %10&user-date; $%5uS %6k %B %(%4L: %*%-25,25a%) %s \n") +@end lisp + +Finally, to sort by spam status, either do it globally: + +@lisp +(setq + gnus-show-threads nil + gnus-article-sort-functions + '(spam-article-sort-by-spam-status)) +@end lisp + +or per group (@pxref{Sorting the Summary Buffer}). + @node Spam ELisp Package Configuration Examples @subsubsection Spam ELisp Package Configuration Examples @cindex spam filtering @@ -22212,7 +22263,7 @@ From Ted Zlatanov . @end example -@subsubheading $B%5!<%P!<>e$N(B IMAP $B%5!<%P!<$G!"E}7WE*$J_I2a4o$H(B @file{spam.el} $B$r;H$&(B +@subsubheading $B%5!<%P!<>e$N(B IMAP $B%5!<%P!<$G!"E}7WE*$J_I2a4o$H(B @code{spam.el} $B$r;H$&(B From Reiner Steib . $B;d$N%W%m%P%$%@$O(B (@acronym{IMAP}) $B%a!<%k%5!<%P!<>e$G(B (@acronym{DCC} $B$HO"(B @@ -22398,6 +22449,13 @@ From Reiner Steib . $B$r(B @code{t} $B$K$7$F2<$5$$!#Cm0U$7$F;H$C$F2<$5$$!#(BBBDB $B$K:\$C$F$$$kAw?.$N$9$Y$F$O(B spammers $B$H$7$FJ,N`$5$l$^$9!#(B +@c TRANSLATEME +While @code{spam-use-BBDB-exclusive} @emph{can} be used as an alias +for @code{spam-use-BBDB} as far as @code{spam.el} is concerned, it is +@emph{not} a separate backend. If you set +@code{spam-use-BBDB-exclusive} to t, @emph{all} your BBDB splitting +will be exclusive. + @end defvar @defvar gnus-group-ham-exit-processor-BBDB @@ -22484,7 +22542,7 @@ Gmane $B$O(B @uref{http://gmane.org} $B$G8+$D$1$k$3$H$,$G$-$^$9!#(B $B%V%i%C%/%[!<%k!&%A%'%C%/$O(B @file{dig.el} $B%Q%C%1!<%8$r;H$$$^$9!#$7$+(B $B$7(B @code{spam-use-dig} $B$r(B @code{nil} $B$K@_Dj$9$l$P!"$h$jNI$$@-G=$N$?$a(B -$B$K(B @file{dns.el} $B$rBe$o$j$K;H$&$3$H$r(B @file{spam.el} $B$K;X<($9$k$3$H$,$G(B +$B$K(B @file{dns.el} $B$rBe$o$j$K;H$&$3$H$r(B @code{spam.el} $B$K;X<($9$k$3$H$,$G(B $B$-$^$9!#8=>u$G$O(B @code{spam-use-dig} $B$r(B @code{nil} $B$K@_Dj$9$k$3$H$O!"$$(B $B$/?M$+$N%f!<%6!<$,;H$($J$$$+$b$7$l$J$$$N$G!"$=$l$,2DG=$J@-G=2~A1$G$"$k$K(B $B$b$+$+$o$i$:?d>)$5$l$^$;$s!#$7$+$7!"$=$l$,F0$/$+$I$&$+$r3N$+$a$k$3$H$O$G(B @@ -22776,7 +22834,7 @@ Emacs Lisp $B$K$h$kE}7WJ,@O4o$G$"$k(B spam-stat.el $B$r(B @code{spam-split} $B$3$H$OJ]>Z$5$l$^$9!#(B @end defvar -$B$3$l$O(B @file{spam.el} $B$,(B @file{spam-stat.el} $B$HF/$-9g$&$3$H$r2DG=$K$7$^(B +$B$3$l$O(B @code{spam.el} $B$,(B @file{spam-stat.el} $B$HF/$-9g$&$3$H$r2DG=$K$7$^(B $B$9!#(B@file{spam-stat.el} $B$O(B (Lisp $B$@$1$N(B) spam $BFbIt%G!<%?%Y!<%9$rDs6!$7$^(B $B$9$,!"$=$l$O(B ifile $B$d(B Bogofilter $B$H0c$C$F30It%W%m%0%i%`$rI,MW$H$7$^$;$s!#(B Spam $B$H(B ham $B$N%W%m%;%C%5!<$H(B @code{spam-split} $B$N$?$a(B @@ -22801,11 +22859,11 @@ Gnus $B$G(B SpamOracle $B$r;H$&$K$O!"$$$/$D$+$N$d$jJ}$,$"$j$^$9!#$9$Y$F$N>l9g Source Specifiers} $B$+$iAv$i$;$k$3$H$G$9!#$3$NJ}K!$K$O!"%f!<%6(B $B$,(B @emph{X-Spam} $B%X%C%@!<$r8+$k$3$H$,$G$-$k$H$$$&MxE@$,$"$j$^$9!#(B -$B$b$C$H$b$NEPO?(B/$B:o=|%k!<%A%s$r=q$$$F2<$5$$!#(B +Write @code{spam-blackbox-register-routine} and +@code{spam-blackbox-unregister-routine} using the bogofilter +register/unregister routines as a start, or other restister/unregister +routines more appropriate to Blackbox, if Blackbox can +register/unregister spam and ham. @item $B4X?t(B -@code{spam-check-blackbox} $B4X?t$r=q$$$F2<$5$$!#$=$l(B -$B$OB>$N=,47$KJo$C$F(B @samp{nil} $B$+(B @code{spam-split-group} $B$rJV$5$J$1$l$P(B -$B$J$j$^$;$s!#$"$J$?$K$G$-$k$3$H$NNc$O!"4{B8$N(B @code{spam-check-*} $B4X?t$r(B -$B;2>H$7$F$/$@$5$$!#$^$?!"$"$J$?$,$=$&$G$J$$M}M3$r40A4$KM}2r$7$F$$$J$$$J$i(B -$B$P!"%F%s%W%l!<%H$Ksv$jIU$$$F2<$5$$!#(B +@code{spam-check-blackbox} $B4X?t$O!"B>$N=,47$KJo$C(B +$B$F(B @samp{nil} $B$+(B @code{spam-split-group} $B$rJV$5$J$1$l$P$J$j$^$;$s!#$"$J(B +$B$?$K$G$-$k$3$H$NNc$O!"4{B8$N(B @code{spam-check-*} $B4X?t$r;2>H$7$F$/$@$5$$!#(B +$B$^$?!"$"$J$?$,$=$&$G$J$$M}M3$r40A4$KM}2r$7$F$$$J$$$J$i$P!"%F%s%W%l!<%H$K(B +$Bsv$jIU$$$F2<$5$$!#(B -$B%V%i%C%/%\%C%/%9$,!"$=$l$,F0:n$9$k$?$a$K%a%C%;!<%8A4BN$rI,MW$H$9$kE}7WE*(B -$B%a!<%kJ,@O4o$G$"$k$N$J$i$P!"(B -@code{spam-list-of-statistical-checks} $B$K(B @code{spam-use-blackbox} $B$rDI(B -$B2C$9$k$3$H$rK:$l$J$$$G2<$5$$!#(B @end enumerate Spam $B$H(B ham $B%a%C%;!<%8$r=hM}$9$k$K$O!"0J2<$rMQ0U$7$F2<$5$$(B: @@ -22998,13 +23034,69 @@ Gnus $B$N%Q%i%a!<%?(B $B$r2C$($F2<$5$$!#$=$l$r%Q%i%a!<%?$HJQ?t$N%+%9%?%^%$%:$NFs2s$K$D$$$F9T$J$&(B $B$3$H$r3N$+$a$F2<$5$$!#(B -@code{gnus.el} $B$N%0%k!<%W%Q%i%a!<%?(B @code{spam-autodetect-methods} $B$K(B - +@c TRANSLATEME +Add @lisp (variable-item spam-use-blackbox) @end lisp +to the @code{spam-autodetect-methods} group parameter in +@code{gnus.el} if Blackbox can check incoming mail for spam contents. + +Finally, use the appropriate @code{spam-install-*-backend} function in +@code{spam.el}. Here are the available functions. + +@enumerate -$B$r2C$($F2<$5$$!#(B +@item +@code{spam-install-backend-alias} + +This function will simply install an alias for a backend that does +everything like the original backend. It is currently only used to +make @code{spam-use-BBDB-exclusive} act like @code{spam-use-BBDB}. + +@item +@code{spam-install-nocheck-backend} + +This function installs a backend that has no check function, but can +register/unregister ham or spam. The @code{spam-use-gmane} backend is +such a backend. + +@item +@code{spam-install-checkonly-backend} + +This function will install a backend that can only check incoming mail +for spam contents. It can't register or unregister messages. +@code{spam-use-blackholes} and @code{spam-use-hashcash} are such +backends. + +@item +@code{spam-install-statistical-checkonly-backend} + +This function installs a statistical backend (one which requires the +full body of a message to check it) that can only check incoming mail +for contents. @code{spam-use-regex-body} is such a filter. + +@item +@code{spam-install-statistical-backend} + +This function install a statistical backend with incoming checks and +registration/unregistration routines. @code{spam-use-bogofilter} is +set up this way. + +@item +@code{spam-install-backend} + +This is the most normal backend installation, where a backend that can +check and register/unregister messages is set up without statistical +abilities. The @code{spam-use-BBDB} is such a backend. + +@item +@code{spam-install-mover-backend} + +Mover backends are internal to @code{spam.el} and specifically move +articles around when the summary is exited. You will very probably +never install such a backend. +@end enumerate @end enumerate diff --git a/texi/gnus.texi b/texi/gnus.texi index ebbf2a1..af51607 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -22564,13 +22564,16 @@ Hashcash Payments}). @cindex spam filtering @cindex spam -The idea behind @file{spam.el} is to have a control center for spam detection -and filtering in Gnus. To that end, @file{spam.el} does two things: it +The idea behind @code{spam.el} is to have a control center for spam detection +and filtering in Gnus. To that end, @code{spam.el} does two things: it filters new mail, and it analyzes mail known to be spam or ham. -@dfn{Ham} is the name used throughout @file{spam.el} to indicate +@dfn{Ham} is the name used throughout @code{spam.el} to indicate non-spam messages. -First of all, you @strong{must} run the function +Make sure you read the section on the @code{spam.el} sequence of +events. See @xref{Spam ELisp Package Sequence of Events}. + +To use @code{spam.el}, you @strong{must} run the function @code{spam-initialize} to autoload @code{spam.el} and to install the @code{spam.el} hooks. There is one exception: if you use the @code{spam-use-stat} (@pxref{spam-stat spam filtering}) setting, you @@ -22581,7 +22584,7 @@ should turn it on before @code{spam-initialize}: (spam-initialize) @end example -So, what happens when you load @file{spam.el}? +So, what happens when you load @code{spam.el}? First, some hooks will get installed by @code{spam-initialize}. There are some hooks for @code{spam-stat} so it can save its databases, and @@ -22620,7 +22623,7 @@ You must have Bogofilter installed for that command to work properly. @end table -Also, when you load @file{spam.el}, you will be able to customize its +Also, when you load @code{spam.el}, you will be able to customize its variables. Try @code{customize-group} on the @samp{spam} variable group. @@ -22628,6 +22631,7 @@ group. * Spam ELisp Package Sequence of Events:: * Spam ELisp Package Filtering of Incoming Mail:: * Spam ELisp Package Global Variables:: +* Spam ELisp Package Sorting and Score Display in Summary Buffer:: * Spam ELisp Package Configuration Examples:: * Blacklists and Whitelists:: * BBDB Whitelists:: @@ -22648,7 +22652,6 @@ group. @cindex spam filtering @cindex spam filtering sequence of events @cindex spam - You must read this section to understand how @code{spam.el} works. Do not skip, speed-read, or glance through this section. @@ -22656,9 +22659,9 @@ There are two @emph{contact points}, if you will, between @code{spam.el} and the rest of Gnus: checking new mail for spam, and leaving a group. -Getting new mail is done in one of two ways. You can either split -your incoming mail or you can classify new articles as ham or spam -when you enter the group. +Getting new mail in Gnus is done in one of two ways. You can either +split your incoming mail or you can classify new articles as ham or +spam when you enter the group. Splitting incoming mail is better suited to mail backends such as @code{nnml} or @code{nnimap} where new mail appears in a single file @@ -22677,12 +22680,14 @@ Gnus does not do further splitting. The @code{spam-autodetect} and (accessible with @kbd{M-x customize-variable} as usual) can help. When @code{spam-autodetect} is used (you can turn it on for a -group/topic or wholesale by regex, as needed), it hooks into the -process of entering a group. Thus, entering a group with unseen or -unread articles becomes the substitute for checking incoming mail. -Whether only unseen articles or all unread articles will be processed -is determined by the @code{spam-autodetect-recheck-messages}. When -set to @code{t}, unread messages will be rechecked. +group/topic or wholesale by regular expression matches, as needed), it +hooks into the process of entering a group. Thus, entering a group +with unseen or unread articles becomes the substitute for checking +incoming mail. Whether only unseen articles or all unread articles +will be processed is determined by the +@code{spam-autodetect-recheck-messages}. When set to @code{t}, unread +messages will be rechecked. You should probably stick with the +default of only checking unseen messages. @code{spam-autodetect} grants the user at once more and less control of spam filtering. The user will have more control over each group's @@ -22705,8 +22710,8 @@ articles (depending on the @code{spam-mark-only-unseen-as-spam} variable) will be marked as spam. Thus, mail split into a spam group gets automatically marked as spam when you enter the group. -So, when you exit a group, the @code{spam-processors} are applied, if -any are set, and the processed mail is moved to the +Thus, when you exit a group, the @code{spam-processors} are applied, +if any are set, and the processed mail is moved to the @code{ham-process-destination} or the @code{spam-process-destination} depending on the article's classification. If the @code{ham-process-destination} or the @code{spam-process-destination}, @@ -22754,7 +22759,7 @@ as typing Lisp one-liners on a neural interface@dots{} err, sorry, that's @cindex spam filtering incoming mail @cindex spam -To use the @file{spam.el} facilities for incoming mail filtering, you +To use the @code{spam.el} facilities for incoming mail filtering, you must add the following to your fancy split list @code{nnmail-split-fancy} or @code{nnimap-split-fancy}: @@ -22829,7 +22834,7 @@ spam checks for your nnmail split vs. your nnimap split. Go crazy. You should still have specific checks such as @code{spam-use-regex-headers} set to @code{t}, even if you specifically invoke @code{spam-split} with the check. The reason is -that when loading @file{spam.el}, some conditional loading is done +that when loading @code{spam.el}, some conditional loading is done depending on what @code{spam-use-xyz} variables you have set. This is usually not critical, though. @@ -22838,18 +22843,15 @@ is usually not critical, though. The boolean variable @code{nnimap-split-download-body} needs to be set, if you want to split based on the whole message instead of just the headers. By default, the nnimap back end will only retrieve the -message headers. If you use @code{spam-check-bogofilter}, -@code{spam-check-ifile}, or @code{spam-check-stat} (the splitters that -can benefit from the full message body), you should set this variable. -It is not set by default because it will slow @acronym{IMAP} down, and -that is not an appropriate decision to make on behalf of the user. +message headers. If you use a @emph{statistical} filter, +e.g. @code{spam-check-bogofilter}, @code{spam-check-ifile}, or +@code{spam-check-stat} (the splitters that can benefit from the full +message body), this variable will be set automatically. It is not set +for non-statistical backends by default because it will slow +@acronym{IMAP} down. @xref{Splitting in IMAP}. -@emph{TODO: spam.el needs to provide a uniform way of training all the -statistical databases. Some have that functionality built-in, others -don't.} - @node Spam ELisp Package Global Variables @subsubsection Spam ELisp Package Global Variables @cindex spam filtering @@ -23023,6 +23025,55 @@ When autodetecting spam, this variable tells @code{spam.el} whether only unseen articles or all unread articles should be checked for spam. It is recommended that you leave it off. +@node Spam ELisp Package Sorting and Score Display in Summary Buffer +@subsubsection Spam ELisp Package Sorting and Score Display in Summary Buffer +@cindex spam scoring +@cindex spam sorting +@cindex spam score summary buffer +@cindex spam sort summary buffer +@cindex spam + +You can display the spam score of articles in your summary buffer, and +you can sort articles by their spam score. + +First you need to decide which backend you will be using. If you use +the @code{spam-use-spamassassin}, +@code{spam-use-spamassassin-headers}, or @code{spam-use-regex-headers} +backend, the @code{X-Spam-Status} header will be used. If you use +@code{spam-use-bogofilter}, the @code{X-Bogosity} header will be used. +If you use @code{spam-use-crm114}, any header that matches the CRM114 +score format will be used. As long as you set the appropriate backend +variable to t @emph{before} you load @code{spam.el}, you will be +fine. @code{spam.el} will automatically add the right header to the +internal Gnus list of required headers. + +To show the spam score in your summary buffer, add this line to your +@code{gnus.el} file (note @code{spam.el} does not do that by default +so it won't override any existing @code{S} formats you may have). + +@lisp +(defalias 'gnus-user-format-function-S 'spam-user-format-function-S) +@end lisp + +Now just set your summary line format to use @code{%uS}. Here's an +example that formats the spam score in a 5-character field: + +@lisp +(setq gnus-summary-line-format + "%U%R %10&user-date; $%5uS %6k %B %(%4L: %*%-25,25a%) %s \n") +@end lisp + +Finally, to sort by spam status, either do it globally: + +@lisp +(setq + gnus-show-threads nil + gnus-article-sort-functions + '(spam-article-sort-by-spam-status)) +@end lisp + +or per group (@pxref{Sorting the Summary Buffer}). + @node Spam ELisp Package Configuration Examples @subsubsection Spam ELisp Package Configuration Examples @cindex spam filtering @@ -23113,7 +23164,7 @@ From Ted Zlatanov . @end example -@subsubheading Using @file{spam.el} on an IMAP server with a statistical filter on the server +@subsubheading Using @code{spam.el} on an IMAP server with a statistical filter on the server From Reiner Steib . My provider has set up bogofilter (in combination with @acronym{DCC}) on @@ -23304,6 +23355,12 @@ unless the sender is in the BBDB. Use with care. Only sender addresses in the BBDB will be allowed through; all others will be classified as spammers. +While @code{spam-use-BBDB-exclusive} @emph{can} be used as an alias +for @code{spam-use-BBDB} as far as @code{spam.el} is concerned, it is +@emph{not} a separate backend. If you set +@code{spam-use-BBDB-exclusive} to t, @emph{all} your BBDB splitting +will be exclusive. + @end defvar @defvar gnus-group-ham-exit-processor-BBDB @@ -23395,7 +23452,7 @@ list is fairly comprehensive, but make sure to let us know if it contains outdated servers. The blackhole check uses the @code{dig.el} package, but you can tell -@file{spam.el} to use @code{dns.el} instead for better performance if +@code{spam.el} to use @code{dns.el} instead for better performance if you set @code{spam-use-dig} to @code{nil}. It is not recommended at this time to set @code{spam-use-dig} to @code{nil} despite the possible performance improvements, because some users may be unable to @@ -23689,7 +23746,7 @@ that you use @code{'(ham spam-use-stat)}. Everything will work the same way, we promise. @end defvar -This enables @file{spam.el} to cooperate with @file{spam-stat.el}. +This enables @code{spam.el} to cooperate with @file{spam-stat.el}. @file{spam-stat.el} provides an internal (Lisp-only) spam database, which unlike ifile or Bogofilter does not require external programs. A spam and a ham processor, and the @code{spam-use-stat} variable for @@ -23714,11 +23771,11 @@ One possibility is to run SpamOracle as a @code{:prescript} from the @xref{Mail Source Specifiers}, (@pxref{SpamAssassin}). This method has the advantage that the user can see the @emph{X-Spam} headers. -The easiest method is to make @file{spam.el} (@pxref{Filtering Spam +The easiest method is to make @code{spam.el} (@pxref{Filtering Spam Using The Spam ELisp Package}) call SpamOracle. @vindex spam-use-spamoracle -To enable SpamOracle usage by @file{spam.el}, set the variable +To enable SpamOracle usage by @code{spam.el}, set the variable @code{spam-use-spamoracle} to @code{t} and configure the @code{nnmail-split-fancy} or @code{nnimap-split-fancy} as described in the section @xref{Filtering Spam Using The Spam ELisp Package}. In @@ -23761,7 +23818,7 @@ false hits or misses, SpamOracle needs training. SpamOracle learns the characteristics of your spam mails. Using the @emph{add} mode (training mode) one has to feed good (ham) and spam mails to SpamOracle. This can be done by pressing @kbd{|} in the Summary buffer -and pipe the mail to a SpamOracle process or using @file{spam.el}'s +and pipe the mail to a SpamOracle process or using @code{spam.el}'s spam- and ham-processors, which is much more convenient. For a detailed description of spam- and ham-processors, @xref{Filtering Spam Using The Spam ELisp Package}. @@ -23831,45 +23888,22 @@ Code "True if blackbox should be used.") @end lisp -Add -@lisp -(spam-use-blackbox . spam-check-blackbox) -@end lisp -to @code{spam-list-of-checks}. +Write @code{spam-check-blackbox} if Blackbox can check incoming mail. -Add -@lisp -(gnus-group-ham-exit-processor-blackbox ham spam-use-blackbox) -(gnus-group-spam-exit-processor-blackbox spam spam-use-blackbox) -@end lisp - -to @code{spam-list-of-processors}. - -Add -@lisp -(spam-use-blackbox spam-blackbox-register-routine - nil - spam-blackbox-unregister-routine - nil) -@end lisp - -to @code{spam-registration-functions}. Write the register/unregister -routines using the bogofilter register/unregister routines as a -start, or other restister/unregister routines more appropriate to -Blackbox. +Write @code{spam-blackbox-register-routine} and +@code{spam-blackbox-unregister-routine} using the bogofilter +register/unregister routines as a start, or other restister/unregister +routines more appropriate to Blackbox, if Blackbox can +register/unregister spam and ham. @item Functionality -Write the @code{spam-check-blackbox} function. It should return -@samp{nil} or @code{spam-split-group}, observing the other -conventions. See the existing @code{spam-check-*} functions for -examples of what you can do, and stick to the template unless you -fully understand the reasons why you aren't. - -Make sure to add @code{spam-use-blackbox} to -@code{spam-list-of-statistical-checks} if Blackbox is a statistical -mail analyzer that needs the full message body to operate. +The @code{spam-check-blackbox} function should return @samp{nil} or +@code{spam-split-group}, observing the other conventions. See the +existing @code{spam-check-*} functions for examples of what you can +do, and stick to the template unless you fully understand the reasons +why you aren't. @end enumerate @@ -23916,7 +23950,64 @@ Add (variable-item spam-use-blackbox) @end lisp to the @code{spam-autodetect-methods} group parameter in -@code{gnus.el}. +@code{gnus.el} if Blackbox can check incoming mail for spam contents. + +Finally, use the appropriate @code{spam-install-*-backend} function in +@code{spam.el}. Here are the available functions. + + +@enumerate + +@item +@code{spam-install-backend-alias} + +This function will simply install an alias for a backend that does +everything like the original backend. It is currently only used to +make @code{spam-use-BBDB-exclusive} act like @code{spam-use-BBDB}. + +@item +@code{spam-install-nocheck-backend} + +This function installs a backend that has no check function, but can +register/unregister ham or spam. The @code{spam-use-gmane} backend is +such a backend. + +@item +@code{spam-install-checkonly-backend} + +This function will install a backend that can only check incoming mail +for spam contents. It can't register or unregister messages. +@code{spam-use-blackholes} and @code{spam-use-hashcash} are such +backends. + +@item +@code{spam-install-statistical-checkonly-backend} + +This function installs a statistical backend (one which requires the +full body of a message to check it) that can only check incoming mail +for contents. @code{spam-use-regex-body} is such a filter. + +@item +@code{spam-install-statistical-backend} + +This function install a statistical backend with incoming checks and +registration/unregistration routines. @code{spam-use-bogofilter} is +set up this way. + +@item +@code{spam-install-backend} + +This is the most normal backend installation, where a backend that can +check and register/unregister messages is set up without statistical +abilities. The @code{spam-use-BBDB} is such a backend. + +@item +@code{spam-install-mover-backend} + +Mover backends are internal to @code{spam.el} and specifically move +articles around when the summary is exited. You will very probably +never install such a backend. +@end enumerate @end enumerate