So here's my helpers to make training your Bayes filter (spamassassin or
other) a bit more convenient.
Plug this into ~/.exmh/lib/, run echo "auto_mkindex ." | tclsh in there to update the library index.
proc learnspam {type} {
global exmh mhProfile
set paths {}
Ftoc_Iterate line {
set msgid [Ftoc_MsgNumber $line]
Exmh_Debug "looking at $msgid in line $line"
if {$msgid != {}} {
lappend paths "$mhProfile(path)/$exmh(folder)/$msgid"
Exmh_Debug "added $mhProfile(path)/$exmh(folder)/$msgid"
}
}
if {[llength $paths] == 0} {
Exmh_Status "No messages selected"
return
}
eval exec learnspam $type $paths &
}
Add this to ~/.exmh/exmh-defaults:
*Mops.ubuttonlist: isspam nospam *Mops.isspam.text: IsSpam *Mops.isspam.command: learnspam spam *Mops.nospam.text: NotSpam *Mops.nospam.command: learnspam hamTogether these to snippets allow you to select messages somewhere and click on one of two buttons (spam/notspam) in the menubar. The tcl bit runs a wrapper called learnspam with args ham or spam and the pathes of your selected messages. All you need to do is create your wrapper to call whatever learning system you have (in my case spamassassin on two remote servers).
