BSFILTER(1)
π BSFILTER π
okay bestie, welcome to bsfilter(1) β the General Commands Manual page that's about to be your inbox's main character. it's a bayesian spam filter and honestly? it's giving bodyguard energy π«Ά
πΈ NAME πΈ
bsfilter β bayesian spam filter. that's it, that's the name, slay.
β¨ SYNOPSIS β¨
bsfilter [options] [commands] < MAIL
bsfilter [options] [commands] MAIL ...
π¦ DESCRIPTION π¦
bsfilter filters out spam mails. periodt. π₯
if commands are specified, bsfilter is in maintenance mode. otherwise it's in filtering mode. two whole modes, very versatile, we love range π
if bsfilter does not find spam in filtering mode, the exit status is 1. yes, literally, not finding spam is a "1". no cap.
if bsfilter runs with the --pipe option or finds spam, the exit status is 0. π
π COMMANDS π
--add-clean,-cβ add mails into the clean token database. π--add-spam,-sβ add mails into the spam token database. π--sub-clean,-Cβ subtract mails from the clean token database.--sub-spam,-Sβ subtract mails from the spam token database.--update,-uβ update the probability table from the clean and spam token databases.--export-cleanβ export the clean token database.--export-spamβ export the spam token database.--import-cleanβ import the clean token database.--import-spamβ import the spam token database.--export-probabilityβ export the probability database (for debugging purpose, bestie).
π OPTIONS π
--homedirdirectory β specify the name of the bsfilter's home directory.- if this option is not used, a directory specified with the environment variable
BSFILTERHOMEis used. - if the variable
BSFILTERHOMEis not defined, the.bsfilterdirectory under your home is used. - if the variable
HOMEis not defined, a directory which bsfilter is located at is used.
- if this option is not used, a directory specified with the environment variable
--config-filefile β specify the name of the bsfilter's configuration file.bsfilter.confin bsfilter's home directory is used by default.--max-linenumber β check and/or study the first number of lines. default is500.0means all. π--dbsdbm|gdbm|bdb1|bdb|qdbmβ specify the name of database type.sdbmby default.--jtokenizerbigram|block|mecab|chasen|kakasi-jbigram|block|mecab|chasen|kakasiβ specify algorithm of a tokenizer for Japanese language.bigramby default.--list-cleanβ print filename of clean mail.--list-spamβ print filename of spam.--imapβ access IMAP server.--imap-serverhostname β specify hostname of IMAP server.--imap-portnumber β specify port number of IMAP server. default is143.--imap-authmethod β specify authorization method. default is"auto"."cram-md5"useAUTHENTICATE CRAM-MD5command."login"useAUTHENTICATE LOGINcommand."loginc"useLOGINcommand."auto"try"cram-md5","login"and"loginc"in this order.--imap-username β specify user name of IMAP server.--imap-passwordpassword β specify password of imap-user.--imap-folder-cleanfolder β specify destination folder for clean mails."inbox.clean"for example.--imap-folder-spamfolder β specify destination folder for spams."inbox.spam"for example.--imap-fetch-unseenβ filter or study mails without SEEN flag.--imap-fetch-unflaggedβ filter or study mails without"X-Spam-Flag"header.--imap-reset-seen-flagβ reset SEEN flag when bsfilter moves or modifies mails.--popβ work as POP proxy.--pid-filefile β specify filename for logging process ID of bsfilter.bsfilter.pidin bsfilter's home directory is used by default. this function is valid when"--pop"is specified.--tasktrayβ sit in tasktray. this is valid with"--pop"on VisualuRuby. π--pop-serverhostname β specify hostname of POP server.--pop-portnumber β specify port number of POP server. default is110.--pop-proxy-ifaddress β specify address of interface which bsfilter listens at. default is0.0.0.0and all interfaces are active.--pop-proxy-portnumber β specify port number which bsfilter listens at. default is10110.--pop-username β optional. specify username of POP server.
bsfilter checks match between value of this options and a name which MUA sends.
in case of mismatch, bsfilter closes sockets. not me getting ghosted by my own proxy π
--pop-proxy-setset[,set...] β specify rules of pop proxy.
alternative way of pop-server, pop-port, pop-proxy-port and pop-user option.
format of "set" is "pop-server:pop-port:[proxy-interface]:proxy-port[:pop-user]".
if proxy-interface is specified and isn't 0.0.0.0 , other interfaces are not used.
"--pop-proxy-set 192.168.1.1:110::10110" is equivalent with "--pop-server 192.168.1.1 --pop-port 110 --pop-proxy-port 10110".
--pop-max-sizenumber β when mail is longer than the specified number, the mail is not filtered. when0is specified, all mails are tested and filtered. unit is byte. default is50000.--sslβ use POP over SSL with--popoption and use IMAP over SSL with--imapoption. π--ssl-certfilename|dirname β specify a filename of a certificate of a trusted CA or a name of a directory of certificates.--methodg|r|rf-mg|r|rfβ specify filtering method."rf"by default."g"means Paul Graham method,"r"means Gary Robinson method, and"rf"means Robinson-Fisher method.--spam-cutoffnumber β specify spam-cutoff value.0.9by default for Paul Graham method.0.582by default for Gary Robinson method.0.95by default for Robinson-Fisher method.--auto-update-aβ recognize mails, add them into clean or spam token database and update the probability table.--disable-degeneration-Dβ disable degeneration during probability table lookup.--disable-utf-8β disable utf-8 support.--refer-headerheader[,header...] β refer specified headers of mails.
bsfilter refers Ufrom, From, To, Cc, Subject, Reply-to, Return-path, Received, Content-Transfer-Encoding, Content-Type, charset, and Content-Disposition by default.
--refer-all-headerβ refer all headers of mails.--ignore-header-Hβ ignore headers of mails. (it is same as--refer-header "".)--ignore-body-Bβ ignore body of mails, except URL or mail address.--ignore-plain-text-partβ ignore plain text part if html part is included in the mail.--ignore-after-last-atagβ ignore text after last"A"tag.--mark-in-tokencharacters β specify characters which are allowable in a token."*'!"by default.--show-processβ show summary of execution.--show-new-tokenβ show tokens which are newly added into the token database.--mboxβ use"unix from"to divide mbox format file.--max-mailnumber β reduce token database when the number of stored mails is larger than this one.10000by default.--min-mailnumber β reduce token database as if this number of mails are stored.8000by default.--pipeβ write a mail to stdout. this options is invalid when"--imap"or"--pop"is specified.--insert-revisionβ insert"X-Spam-Revision: bsfilter release..."into a mail.--insert-flagβ insert"X-Spam-Flag: Yes"or"X-Spam-Flag: No"into a mail.--insert-probabilityβ insert"X-Spam-Probability: number"into a mail.--header-prefixstring β insert"X-specified_string-..."headers, instead of"Spam". (it is valid with--insert-flagand/or--insert-probabilityoption.)--mark-spam-subjectβ insert"[SPAM] "at the beginning of Subject header.--mark-subject-prefixstring β insert specified string, instead of"[SPAM] ". (it is valid with--mark-spam-subjectoption.)--show-db-statusβ show numbers of tokens and mails in databases and quit.--help-hβ show help message.--quiet-qβ quiet mode. π€«--verbose-vβ verbose mode. π£οΈ--debug-dβ debug mode. π
π EXAMPLES π
% bsfilter -s ~/Mail/spam/* ## add spam
% bsfilter -u -c ~/Mail/job/* ~/Mail/private/* ## add clean mails and update probability table
% bsfilter ~/Mail/inbox/1 ## show spam probability
## recipe of procmail
:0 HB
* ? bsfilter -a
spam/.
## recipe of procmail
:0 fw
| bsfilter -a --pipe --insert-flag --insert-probability
β SEE ALSO β
https://nbkenichi.github.io/bsfilter/index-e.html
π AUTHOR π
The original manual is in the bsfilter command it self which is written by NABEYA Kenichi (upstream author). This manual page was transrated from the manual by akira yamada <akira@debian.org> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
and that's the whole page bestie π
β¨ you just read the bsfilter(1) page from the General Commands Manual β that's the manual name right there, cute little header energy, folded in like a hair clip π go forth and let your spam folder know who's boss, mwah ππ¦πΈ
π¦ where this page comes from
- debian trixie: bsfilter 1:1.0.20~rc6-1 Β· GPL-2.0-or-later
- ubuntu resolute: bsfilter 1:1.0.20~rc6-1 Β· GPL-2.0-or-later
- ubuntu stonking: bsfilter 1:1.0.20-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms