@cindex spam filtering
@cindex spam
-@file{spam.el} \e$B$N??$NL\E*$O\e(B spam \e$B8!=P$H_I2a$N$?$a$N41@)%;%s%?!<\e(B
-\e$B$r\e(B gnus \e$B$NCf$K;}$D$3$H$G$9!#$=$N$?$a$K\e(B @file{spam.el} \e$B$OFs$D$N$3$H$r9T$J\e(B
+@code{spam.el} \e$B$N??$NL\E*$O\e(B spam \e$B8!=P$H_I2a$N$?$a$N41@)%;%s%?!<\e(B
+\e$B$r\e(B gnus \e$B$NCf$K;}$D$3$H$G$9!#$=$N$?$a$K\e(B @code{spam.el} \e$B$OFs$D$N$3$H$r9T$J\e(B
\e$B$$$^$9\e(B: \e$B?7$7$$%a!<%k$r_I2a$7!"\e(Bspam \e$B$^$?$O\e(B ham \e$B$H$7$FCN$i$l$k%a!<%k$rJ,@O\e(B
-\e$B$9$k$3$H$G$9!#\e(B@dfn{Ham} \e$B$O\e(B @file{spam.el} \e$B$N$$$?$k=j$G\e(B spam \e$B$G$O$J$$%a%C\e(B
+\e$B$9$k$3$H$G$9!#\e(B@dfn{Ham} \e$B$O\e(B @code{spam.el} \e$B$N$$$?$k=j$G\e(B spam \e$B$G$O$J$$%a%C\e(B
\e$B%;!<%8$r<($9$?$a$K;H$&L>A0$G$9!#\e(B
-\e$BBh0l$K!"\e(B@code{spam.el} \e$B$r<+F0FI$_9~$_\e(B (autoload) \e$B$7$F\e(B @code{spam.el} \e$B$N\e(B
-\e$B3F%U%C%/$r%$%s%9%H!<%k$9$k$?$a$K!"4X\e(B
+@code{spam.el} \e$B%7!<%1%s%9$N%$%Y%s%H$N9`$r$A$c$s$HFI$_$^$7$g$&!#\e(B
+@ref{Spam ELisp Package Sequence of Events} \e$B$r;2>H$7$F2<$5$$!#\e(B
+
+@code{spam.el} \e$B$r;H$&$K$O!"\e(B@code{spam.el} \e$B$r<+F0FI$_9~$_\e(B (autoload) \e$B$7\e(B
+\e$B$F\e(B @code{spam.el} \e$B$N3F%U%C%/$r%$%s%9%H!<%k$9$k$?$a$K!"4X\e(B
\e$B?t\e(B @code{spam-initialize} \e$B$r\e(B @strong{\e$B<B9T$7$J$1$l$P$J$j$^$;$s\e(B}\e$B!#0l$DNc30\e(B
\e$B$,$"$j$^$9\e(B: \e$B$b$7\e(B @code{spam-use-stat} \e$B$N@_Dj$r;H$&\e(B (@pxref{spam-stat
spam filtering}) \e$B$N$G$"$l$P!"$=$l$r\e(B @code{spam-initialize} \e$B$h$jA0\e(B
(spam-initialize)
@end example
-\e$B$G$O\e(B @file{spam.el} \e$B$rFI$_9~$`$H2?$,5/$-$k$G$7$g$&$+\e(B?
+\e$B$G$O\e(B @code{spam.el} \e$B$rFI$_9~$`$H2?$,5/$-$k$G$7$g$&$+\e(B?
\e$BBh0l$K\e(B @code{spam-initialize} \e$B$K$h$C$F$$$/$D$+$N%U%C%/$,F0:n$9$k$h$&$K$J\e(B
\e$B$j$^$9!#\e(B@code{spam-stat} \e$B$,$=$l$i$N%G!<%?%Y!<%9$r%;!<%V$G$-$k$h$&$K$9$k\e(B
\e$B%U%C%/$H!"%0%k!<%W$KF~$k$H$-$HH4$1$k$H$-$K6=L#?<$$J*;v$r5/$3$9%U%C%/$,$"\e(B
-\e$B$j$^$9!#%$%Y%s%H$N%7!<%1%s%9$K$D$$$F$N>\:Y$O8e=R\e(B (@pxref{Spam ELisp
+\e$B$j$^$9!#%7!<%1%s%9$N%$%Y%s%H$K$D$$$F$N>\:Y$O8e=R\e(B (@pxref{Spam ELisp
Package Sequence of Events})\e$B!#\e(B
\e$B0J2<$N%-!<%\!<%IL?Na$,;H$($k$h$&$K$J$j$^$9\e(B:
@end table
-\e$B$^$?!"\e(B@file{spam.el} \e$B$rFI$_9~$`$H!"$=$NJQ?t72$r%+%9%?%^%$%:$9$k$3$H$,$G\e(B
+\e$B$^$?!"\e(B@code{spam.el} \e$B$rFI$_9~$`$H!"$=$NJQ?t72$r%+%9%?%^%$%:$9$k$3$H$,$G\e(B
\e$B$-$k$h$&$K$J$j$^$9!#\e(B@samp{spam} \e$BJQ?t%0%k!<%W$K$D$$\e(B
\e$B$F\e(B @code{customize-group} \e$B$r;n$7$F$_$F2<$5$$!#\e(B
* 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::
@cindex spam filtering
@cindex spam filtering sequence of events
@cindex spam
-
\e$B$I$N$h$&$K\e(B @code{spam.el} \e$B$,F/$/$+$rM}2r$9$k$?$a$K!"I,$:$3$N9`$rFI$s$G2<\e(B
\e$B$5$$!#FI$_Ht$P$7!"B.FI!"$^$?$O<P$aFI$_$7$F$O$$$1$^$;$s!#\e(B
@code{spam.el} \e$B$H\e(B Gnus \e$B$N4V$K$O!"Fs$D$N\e(B @emph{\e$B@\E@\e(B} \e$B$,$"$k$H9M$($i$l$^$9!#\e(B
Spam \e$B$N$?$a$K?7Ce%a!<%k$r8!::$9$k$H$-!"$*$h$S%0%k!<%W$rH4$1$k$H$-$G$9!#\e(B
-\e$B?7Ce%a!<%k$N<hF@$O!"Fs$D$NJ}K!$N0lJ}$G9T$J$o$l$^$9!#?7Ce%a!<%k$rJ,3d$9$k\e(B
-\e$B$+!"%0%k!<%W$KF~$k$H$-$K?7$7$$5-;v$r\e(B ham \e$B$H\e(B spam \e$B$KJ,N`$9$k$+$N!"$I$A$i\e(B
-\e$B$G$b2DG=$G$9!#\e(B
+Gnus \e$B$K$*$1$k?7Ce%a!<%k$N<hF@$O!"Fs$D$NJ}K!$N0lJ}$G9T$J$o$l$^$9!#?7Ce%a!<\e(B
+\e$B%k$rJ,3d$9$k$+!"%0%k!<%W$KF~$k$H$-$K?7$7$$5-;v$r\e(B ham \e$B$H\e(B spam \e$B$KJ,N`$9$k\e(B
+\e$B$+$N!"$I$A$i$G$b2DG=$G$9!#\e(B
\e$B?7Ce%a!<%k$NJ,3d$O!"\e(B@code{nnml} \e$B$d\e(B @code{nnimap} \e$B$N$h$&$K!"?7$7$$%a!<%k\e(B
\e$B$,\e(B @dfn{Spool File} \e$B$H8F$P$l$k0l$D$N%U%!%$%k$K$J$k%P%C%/%(%s%I$K!"$h$jE,\e(B
\e$BA`:n2D\e(B) \e$B$,LrN)$A$^$9!#\e(B
@code{spam-autodetect} \e$B$,;H$o$l$k>l9g\e(B (\e$B$=$l$O%0%k!<%W\e(B/\e$B%H%T%C%/$K$D$$$F!"\e(B
-\e$B$"$k$$$OI,MW$K1~$8$F==GD$R$H$+$i$2$K\e(B ON \e$B$K$G$-$^$9\e(B)\e$B!"$=$l$O%0%k!<%W$KF~\e(B
-\e$B$k\e(B (\e$B$=$N%0%k!<%W$N35N,%P%C%U%!$K0\F0$9$k\e(B) \e$B=hM}$K$*$$$F<B9T$5$l$^$9!#$7$?\e(B
-\e$B$,$C$F!"$^$@FI$^$l$?$3$H$,L5$$!"$^$?$OL$FI$N5-;v$,$"$k%0%k!<%W$KF~$k$3$H\e(B
-\e$B$O!"?7Ce%a!<%k$N8!::$NBe$o$j$K$J$j$^$9!#$^$@FI$^$l$?$3$H$,L5$$5-;v!"$^$?\e(B
-\e$B$O$9$Y$F$NL$FI$N5-;v$,=hM}$5$l$k$+$I$&$+$O!"\e(B
+\e$B$"$k$$$OI,MW$K1~$8$F!"@55,I=8=$N9gCW$K$h$C$F==GD$R$H$+$i$2$K\e(B ON \e$B$K$G$-$^\e(B
+\e$B$9\e(B)\e$B!"$=$l$O%0%k!<%W$KF~$k\e(B (\e$B$=$N%0%k!<%W$N35N,%P%C%U%!$K0\F0$9$k\e(B) \e$B=hM}$K\e(B
+\e$B$*$$$F<B9T$5$l$^$9!#$7$?$,$C$F!"$^$@FI$^$l$?$3$H$,L5$$!"$^$?$OL$FI$N5-;v\e(B
+\e$B$,$"$k%0%k!<%W$KF~$k$3$H$O!"?7Ce%a!<%k$N8!::$NBe$o$j$K$J$j$^$9!#$^$@FI$^\e(B
+\e$B$l$?$3$H$,L5$$5-;v!"$^$?$O$9$Y$F$NL$FI$N5-;v$,=hM}$5$l$k$+$I$&$+$O!"\e(B
@code{spam-autodetect-recheck-messages} \e$B$K$h$C$F7h$^$j$^$9!#\e(B@code{t} \e$B$K\e(B
-\e$B@_Dj$5$l$k$H!"L$FI$N%a%C%;!<%8$,:F8!::$5$l$^$9!#\e(B
+\e$B@_Dj$5$l$k$H!"L$FI$N%a%C%;!<%8$,:F8!::$5$l$^$9!#$*$=$i$/!"$^$@FI$^$l$?$3\e(B
+\e$B$H$,L5$$%a%C%;!<%8$N%G%#%U%)%k%H$N8!::$@$1$O!"Ce<B$K9T$J$o$J$1$l$P$J$i$J\e(B
+\e$B$$$G$7$g$&!#\e(B
@code{spam-autodetect} \e$B$O!"B?>/$J$j$H$b\e(B spam \e$B_I2a$N4IM}$r%f!<%6$K5v2D$7\e(B
\e$B$^$9!#%f!<%6$O3F%0%k!<%W$N\e(B spam \e$B8!=P$N<jCJ$r$h$jB?$/4IM}$9$k$3$H$,$G$-$k\e(B
@cindex spam filtering incoming mail
@cindex spam
-\e$BF~$C$F$/$k%a!<%k$r_I2a$9$kL\E*$G\e(B @file{spam.el} \e$B$r;H$&$K$O!"FC5iJ,3d%j%9\e(B
+\e$BF~$C$F$/$k%a!<%k$r_I2a$9$kL\E*$G\e(B @code{spam.el} \e$B$r;H$&$K$O!"FC5iJ,3d%j%9\e(B
\e$B%H\e(B @code{nnmail-split-fancy} \e$B$^$?$O\e(B @code{nnimap-split-fancy} \e$B$K0J2<$rDI\e(B
\e$B2C$7$J$1$l$P$J$j$^$;$s\e(B:
\e$B8!::$HF1;~$KL@$i$+$K\e(B @code{spam-split} \e$B$r<B9T$9$k$H$7$F$b!":#$^$G$H$*\e(B
\e$B$j\e(B @code{spam-use-regex-headers} \e$B$r\e(B @code{t} \e$B$K@_Dj$9$k$h$&$J8!::$r9T$C\e(B
-\e$B$F$$$J$1$l$P$J$j$^$;$s!#$J$<$J$i\e(B @file{spam.el} \e$B$rFI$_9~$`$H$-$K!"$"$J$?\e(B
+\e$B$F$$$J$1$l$P$J$j$^$;$s!#$J$<$J$i\e(B @code{spam.el} \e$B$rFI$_9~$`$H$-$K!"$"$J$?\e(B
\e$B$,2?$N\e(B @code{spam-use-xyz} \e$BJQ?t$r@_Dj$7$F$$$k$+$K1~$8$?!"$$$/$D$+$N>r7o\e(B
\e$BIU$-$NFI$_9~$_$,9T$o$l$k$+$i$G$9!#\e(B
\e$B%X%C%@!<$@$1$G$O$J$/$F%a%C%;!<%8A4BN$K4p$E$$$FJ,3d$r9T$J$$$?$$>l9g$O!"%V!<\e(B
\e$B%kJQ?t\e(B @code{nnimap-split-download-body} \e$B$,@_Dj$5$l$kI,MW$,$"$j$^$9!#%G%#\e(B
\e$B%U%)%k%H$G$O!"\e(Bnnimap \e$B%P%C%/%(%s%I$O%a%C%;!<%8%X%C%@!<$@$1$r<h$j9~$_$^$9!#\e(B
-@code{spam-check-bogofilter}\e$B!"\e(B@code{spam-check-ifile} \e$B$^$?\e(B
+\e$BNc$($P\e(B @code{spam-check-bogofilter}\e$B!"\e(B@code{spam-check-ifile} \e$B$^$?\e(B
\e$B$O\e(B @code{spam-check-stat} (\e$B$=$l$i$NJ,3d4o$O%a%C%;!<%8$NK\J8A4BN$+$i>pJs\e(B
-\e$B$rF@$k\e(B) \e$B$r;H$&$J$i$P!"$3$NJQ?t$r@_Dj$7$J$1$l$P$J$j$^$;$s!#$=$l\e(B
-\e$B$O\e(B @acronym{IMAP} \e$B$NF0:n$rCY$/$7$F$7$^$$!"%f!<%6$rBeI=$9$k$N$K$U$5$o$7$$\e(B
-\e$B7hDj$G$O$J$$$N$G!"%G%#%U%)%k%H$G$O@_Dj$5$l$F$$$^$;$s!#\e(B
+\e$B$rF@$k\e(B) \e$B$N$h$&$J\e(B @emph{\e$BE}7WE*$J\e(B} \e$B_I2a4o$r;H$&$J$i$P!"$3$NJQ?t$O<+F0E*$K\e(B
+\e$B@_Dj$5$l$k$G$7$g$&!#$=$l$O\e(B @acronym{IMAP} \e$B$NF0:n$rCY$/$7$F$7$^$&$N$G!"E}\e(B
+\e$B7WE*$G$O$J$$%P%C%/%(%s%I$KBP$7$F%G%#%U%)%k%H$G$O@_Dj$5$l$F$$$^$;$s!#\e(B
@xref{Splitting in IMAP}.
-@emph{TODO: spam.el \e$B$O$9$Y$F$NE}7W%G!<%?%Y!<%9$r%H%l!<%K%s%0$9$k$?$a$N0l\e(B
-\e$BDjITJQ$NJ}K!$rDs6!$9$kI,MW$,$"$j$^$9!#$$$/$D$+$O$=$N5!G=$r<+A0$G;}$C$F$$\e(B
-\e$B$^$9$,!"$=$&$G$J$$$b$N$b$"$j$^$9!#\e(B}
-
@node Spam ELisp Package Global Variables
@subsubsection Spam ELisp Package Global Variables
@cindex spam filtering
\e$B$3$H$,L5$$5-;v$@$1!"$^$?$O$9$Y$F$NL$FI5-;v$N\e(B spam \e$B8!::$r9T$J$&$+$I$&$+$r\e(B
\e$B;X<($7$^$9!#$3$l$O$=$N$^$^$K$7$F$*$/$3$H$r4+$a$^$9!#\e(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
@end example
-@subsubheading \e$B%5!<%P!<>e$N\e(B IMAP \e$B%5!<%P!<$G!"E}7WE*$J_I2a4o$H\e(B @file{spam.el} \e$B$r;H$&\e(B
+@subsubheading \e$B%5!<%P!<>e$N\e(B IMAP \e$B%5!<%P!<$G!"E}7WE*$J_I2a4o$H\e(B @code{spam.el} \e$B$r;H$&\e(B
From Reiner Steib <reiner.steib@@gmx.de>.
\e$B;d$N%W%m%P%$%@$O\e(B (@acronym{IMAP}) \e$B%a!<%k%5!<%P!<>e$G\e(B (@acronym{DCC} \e$B$HO"\e(B
\e$B$r\e(B @code{t} \e$B$K$7$F2<$5$$!#Cm0U$7$F;H$C$F2<$5$$!#\e(BBBDB \e$B$K:\$C$F$$$kAw?.<T\e(B
\e$B$@$1$,DL9T$r5v$5$l!"B>$N$9$Y$F$O\e(B spammers \e$B$H$7$FJ,N`$5$l$^$9!#\e(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
\e$B%V%i%C%/%[!<%k!&%A%'%C%/$O\e(B @file{dig.el} \e$B%Q%C%1!<%8$r;H$$$^$9!#$7$+\e(B
\e$B$7\e(B @code{spam-use-dig} \e$B$r\e(B @code{nil} \e$B$K@_Dj$9$l$P!"$h$jNI$$@-G=$N$?$a\e(B
-\e$B$K\e(B @file{dns.el} \e$B$rBe$o$j$K;H$&$3$H$r\e(B @file{spam.el} \e$B$K;X<($9$k$3$H$,$G\e(B
+\e$B$K\e(B @file{dns.el} \e$B$rBe$o$j$K;H$&$3$H$r\e(B @code{spam.el} \e$B$K;X<($9$k$3$H$,$G\e(B
\e$B$-$^$9!#8=>u$G$O\e(B @code{spam-use-dig} \e$B$r\e(B @code{nil} \e$B$K@_Dj$9$k$3$H$O!"$$\e(B
\e$B$/?M$+$N%f!<%6!<$,;H$($J$$$+$b$7$l$J$$$N$G!"$=$l$,2DG=$J@-G=2~A1$G$"$k$K\e(B
\e$B$b$+$+$o$i$:?d>)$5$l$^$;$s!#$7$+$7!"$=$l$,F0$/$+$I$&$+$r3N$+$a$k$3$H$O$G\e(B
\e$B$3$H$OJ]>Z$5$l$^$9!#\e(B
@end defvar
-\e$B$3$l$O\e(B @file{spam.el} \e$B$,\e(B @file{spam-stat.el} \e$B$HF/$-9g$&$3$H$r2DG=$K$7$^\e(B
+\e$B$3$l$O\e(B @code{spam.el} \e$B$,\e(B @file{spam-stat.el} \e$B$HF/$-9g$&$3$H$r2DG=$K$7$^\e(B
\e$B$9!#\e(B@file{spam-stat.el} \e$B$O\e(B (Lisp \e$B$@$1$N\e(B) spam \e$BFbIt%G!<%?%Y!<%9$rDs6!$7$^\e(B
\e$B$9$,!"$=$l$O\e(B ifile \e$B$d\e(B Bogofilter \e$B$H0c$C$F30It%W%m%0%i%`$rI,MW$H$7$^$;$s!#\e(B
Spam \e$B$H\e(B ham \e$B$N%W%m%;%C%5!<$H\e(B @code{spam-split} \e$B$N$?$a\e(B
Source Specifiers} \e$B$+$iAv$i$;$k$3$H$G$9!#$3$NJ}K!$K$O!"%f!<%6\e(B
\e$B$,\e(B @emph{X-Spam} \e$B%X%C%@!<$r8+$k$3$H$,$G$-$k$H$$$&MxE@$,$"$j$^$9!#\e(B
-\e$B$b$C$H$b<j7Z$JJ}K!$O!"\e(B@file{spam.el} (@pxref{Filtering Spam Using The
+\e$B$b$C$H$b<j7Z$JJ}K!$O!"\e(B@code{spam.el} (@pxref{Filtering Spam Using The
Spam ELisp Package}) \e$B$,\e(B SpamOracle \e$B$r8F$V$h$&$K$9$k$3$H$G$9!#\e(B
@vindex spam-use-spamoracle
-@file{spam.el} \e$B$,\e(B SpamOracle \e$B$r;H$($k$h$&$K$9$k$K$O!"JQ\e(B
+@code{spam.el} \e$B$,\e(B SpamOracle \e$B$r;H$($k$h$&$K$9$k$K$O!"JQ\e(B
\e$B?t\e(B @code{spam-use-spamoracle} \e$B$r\e(B @code{t} \e$B$K$7$F!"\e(B@ref{Filtering Spam
Using The Spam ELisp Package} \e$B$N9`$G=R$Y$i$l$F$$$k$h$&\e(B
\e$B$K\e(B @code{nnmail-split-fancy} \e$B$+\e(B @code{nnimap-split-fancy} \e$B$r@_Dj$7$F2<$5\e(B
@emph{add} \e$B%b!<%I\e(B (\e$B%H%l!<%K%s%0!&%b!<%I\e(B) \e$B$r;H$C$F!"NI$$%a!<\e(B
\e$B%k\e(B (ham) \e$B$H\e(B spam \e$B$r\e(B SpamOracle \e$B$KM?$($J$1$l$P$J$j$^$;$s!#$3$l$O!"35N,%P%C\e(B
\e$B%U%!$G\e(B @kbd{|} \e$B$r2!$9$3$H$K$h$C$F%a!<%k$r\e(B SpamOracle \e$B$N%W%m%;%9$K%Q%$%W\e(B
-\e$B$9$k$+!"$^$?$O\e(B @file{spam.el} \e$B$N\e(B spam \e$B$*$h$S\e(B ham \e$B%W%m%;%C%5!<$r;H$&$3$H\e(B
+\e$B$9$k$+!"$^$?$O\e(B @code{spam.el} \e$B$N\e(B spam \e$B$*$h$S\e(B ham \e$B%W%m%;%C%5!<$r;H$&$3$H\e(B
\e$B$K$h$C$F9T$J$&$3$H$,$G$-$^$9!"\e(B@xref{Filtering Spam Using The Spam ELisp
Package}.
"Blackbox \e$B$r;H$&$H$-$O\e(B t \e$B$K$9$k!#\e(B")
@end lisp
-@code{spam-list-of-checks} \e$B$K\e(B
+@c TRANSLATEME
+Write @code{spam-check-blackbox} if Blackbox can check incoming mail.
-@lisp
-(spam-use-blackbox . spam-check-blackbox)
-@end lisp
-
-\e$B$rDI2C!#\e(B@code{spam-list-of-processors} \e$B$K\e(B
-
-@lisp
-(gnus-group-ham-exit-processor-blackbox ham spam-use-blackbox)
-(gnus-group-spam-exit-processor-blackbox spam spam-use-blackbox)
-@end lisp
-
-\e$B$rDI2C!#\e(B@code{spam-registration-functions} \e$B$K\e(B
-
-@lisp
-(spam-use-blackbox spam-blackbox-register-routine
- nil
- spam-blackbox-unregister-routine
- nil)
-@end lisp
-
-\e$B$rDI2C!#\e(B
-
-\e$B<j;O$a$K\e(B bogofilter \e$B$NEPO?\e(B/\e$B:o=|%k!<%A%s$r;H$C$FEPO?\e(B/\e$B:o=|%k!<%A%s$r!"$^$?\e(B
-\e$B$O$b$C$H\e(B Blackbox \e$B$KE,@Z$JB>$NEPO?\e(B/\e$B:o=|%k!<%A%s$r=q$$$F2<$5$$!#\e(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
\e$B4X?t\e(B
-@code{spam-check-blackbox} \e$B4X?t$r=q$$$F2<$5$$!#$=$l\e(B
-\e$B$OB>$N=,47$KJo$C$F\e(B @samp{nil} \e$B$+\e(B @code{spam-split-group} \e$B$rJV$5$J$1$l$P\e(B
-\e$B$J$j$^$;$s!#$"$J$?$K$G$-$k$3$H$NNc$O!"4{B8$N\e(B @code{spam-check-*} \e$B4X?t$r\e(B
-\e$B;2>H$7$F$/$@$5$$!#$^$?!"$"$J$?$,$=$&$G$J$$M}M3$r40A4$KM}2r$7$F$$$J$$$J$i\e(B
-\e$B$P!"%F%s%W%l!<%H$Ksv$jIU$$$F2<$5$$!#\e(B
+@code{spam-check-blackbox} \e$B4X?t$O!"B>$N=,47$KJo$C\e(B
+\e$B$F\e(B @samp{nil} \e$B$+\e(B @code{spam-split-group} \e$B$rJV$5$J$1$l$P$J$j$^$;$s!#$"$J\e(B
+\e$B$?$K$G$-$k$3$H$NNc$O!"4{B8$N\e(B @code{spam-check-*} \e$B4X?t$r;2>H$7$F$/$@$5$$!#\e(B
+\e$B$^$?!"$"$J$?$,$=$&$G$J$$M}M3$r40A4$KM}2r$7$F$$$J$$$J$i$P!"%F%s%W%l!<%H$K\e(B
+\e$Bsv$jIU$$$F2<$5$$!#\e(B
-\e$B%V%i%C%/%\%C%/%9$,!"$=$l$,F0:n$9$k$?$a$K%a%C%;!<%8A4BN$rI,MW$H$9$kE}7WE*\e(B
-\e$B%a!<%kJ,@O4o$G$"$k$N$J$i$P!"\e(B
-@code{spam-list-of-statistical-checks} \e$B$K\e(B @code{spam-use-blackbox} \e$B$rDI\e(B
-\e$B2C$9$k$3$H$rK:$l$J$$$G2<$5$$!#\e(B
@end enumerate
Spam \e$B$H\e(B ham \e$B%a%C%;!<%8$r=hM}$9$k$K$O!"0J2<$rMQ0U$7$F2<$5$$\e(B:
\e$B$r2C$($F2<$5$$!#$=$l$r%Q%i%a!<%?$HJQ?t$N%+%9%?%^%$%:$NFs2s$K$D$$$F9T$J$&\e(B
\e$B$3$H$r3N$+$a$F2<$5$$!#\e(B
-@code{gnus.el} \e$B$N%0%k!<%W%Q%i%a!<%?\e(B @code{spam-autodetect-methods} \e$B$K\e(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
-\e$B$r2C$($F2<$5$$!#\e(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
@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
(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
@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.
* 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::
@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.
@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
(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
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},
@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}:
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.
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
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
@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 <reiner.steib@@gmx.de>.
My provider has set up bogofilter (in combination with @acronym{DCC}) on
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
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
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
@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
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}.
"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
(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