BSFILTER(1)

πŸ“¦
version 1.0.20 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 🌈

  • --homedir directory β€” specify the name of the bsfilter's home directory.
    • if this option is not used, a directory specified with the environment variable BSFILTERHOME is used.
    • if the variable BSFILTERHOME is not defined, the .bsfilter directory under your home is used.
    • if the variable HOME is not defined, a directory which bsfilter is located at is used.
  • --config-file file β€” specify the name of the bsfilter's configuration file. bsfilter.conf in bsfilter's home directory is used by default.
  • --max-line number β€” check and/or study the first number of lines. default is 500. 0 means all. 🌟
  • --db sdbm|gdbm|bdb1|bdb|qdbm β€” specify the name of database type. sdbm by default.
  • --jtokenizer bigram|block|mecab|chasen|kakasi
  • -j bigram|block|mecab|chasen|kakasi β€” specify algorithm of a tokenizer for Japanese language. bigram by default.
  • --list-clean β€” print filename of clean mail.
  • --list-spam β€” print filename of spam.
  • --imap β€” access IMAP server.
  • --imap-server hostname β€” specify hostname of IMAP server.
  • --imap-port number β€” specify port number of IMAP server. default is 143.
  • --imap-auth method β€” specify authorization method. default is "auto". "cram-md5" use AUTHENTICATE CRAM-MD5 command. "login" use AUTHENTICATE LOGIN command. "loginc" use LOGIN command. "auto" try "cram-md5", "login" and "loginc" in this order.
  • --imap-user name β€” specify user name of IMAP server.
  • --imap-password password β€” specify password of imap-user.
  • --imap-folder-clean folder β€” specify destination folder for clean mails. "inbox.clean" for example.
  • --imap-folder-spam folder β€” 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-file file β€” specify filename for logging process ID of bsfilter. bsfilter.pid in 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-server hostname β€” specify hostname of POP server.
  • --pop-port number β€” specify port number of POP server. default is 110.
  • --pop-proxy-if address β€” specify address of interface which bsfilter listens at. default is 0.0.0.0 and all interfaces are active.
  • --pop-proxy-port number β€” specify port number which bsfilter listens at. default is 10110.
  • --pop-user name β€” 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-set set[,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-size number β€” when mail is longer than the specified number, the mail is not filtered. when 0 is specified, all mails are tested and filtered. unit is byte. default is 50000.
  • --ssl β€” use POP over SSL with --pop option and use IMAP over SSL with --imap option. πŸ”’
  • --ssl-cert filename|dirname β€” specify a filename of a certificate of a trusted CA or a name of a directory of certificates.
  • --method g|r|rf
  • -m g|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-cutoff number β€” specify spam-cutoff value. 0.9 by default for Paul Graham method. 0.582 by default for Gary Robinson method. 0.95 by 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-header header[,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-token characters β€” 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-mail number β€” reduce token database when the number of stored mails is larger than this one. 10000 by default.
  • --min-mail number β€” reduce token database as if this number of mails are stored. 8000 by 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-prefix string β€” insert "X-specified_string-..." headers, instead of "Spam". (it is valid with --insert-flag and/or --insert-probability option.)
  • --mark-spam-subject β€” insert "[SPAM] " at the beginning of Subject header.
  • --mark-subject-prefix string β€” insert specified string, instead of "[SPAM] ". (it is valid with --mark-spam-subject option.)
  • --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