BMF(1)
๐ BMF(1) โ like, the manual page, bestie ๐
okay so you opened man 1 bmf and you're here now, and honestly? iconic choice. this is the BMF(1) page and i'm gonna walk you through it like we're texting at 2am. grab a snack. ๐
โจ NAME โจ
bmf โ the efficient Bayesian mail filter. yes bestie, Bayesian. it's giving statistics major. ๐
๐ฆ SYNOPSIS ๐ฆ
bmf [-t] [-n] [-s] [-N] [-S] [-f fmt] [-d db] [-i file] [-k n] [-m type] [-p]
[-v] [-V] [-h]
๐ธ DESCRIPTION ๐ธ
so bmf is a Bayesian mail filter, fr fr. in its normal mode of operation it takes an email message or literally any other text on standard input, does a statistical check against lists of "good" and "spam" words, registers the new data, and returns a status code telling you whether or not the message is spam. that's the whole vibe check.
BMF is written with fast, zero-copy algorithms, coded directly in C, and tuned for speed. no cap. it aims to be faster, smaller, and more versatile than similar applications. main character energy, honestly. ๐
bmf supports both mbox and maildir mail storage formats. and it will automatically process multiple messages within an mbox file separately โ like, one at a time, no crumbs left behind. โจ
๐ OPTIONS ๐
Without command-line options, bmf processes the input, registers it as either "good" or "spam", and returns the appropriate error code. The wordlist directory and nonexistent wordfiles are created if absent. (yes, it just does that. self-sufficient queen. ๐ซถ)
-tโ Test to see if the input is spam. The word lists are not updated. A report is written tostdoutshowing the final score and the tokens with the highest deviation form a mean of0.5. (look, don't touch, just look. ๐ )-nโ Register the input as non-spam. good vibes only.-sโ Register the input as spam. ๐ซ-Nโ Register the input as non-spam and undo a prior registration as spam. it's giving redemption arc.-Sโ Register the input as spam and undo a prior registration as non-spam. plot twist. ๐ญ-ffmt โ Specify database format. Valid formats aretext,db, andmysql.Textis always valid. The others may not be available if the corresponding option was not enabled at compile time. The default isdbif available, elsetext.-ddb โ Specify database or directory for loading and saving word lists. The default is~/.bmfin text mode.-ifile โ Use file for input instead ofstdin. no pipe required, we're fancy now.-kn โ Specify the number of extrema (keepers) to use in the Bayes calculation. The default is15.-mfmt โ Specify mail storage format. Valid formats aremboxandmaildir. The default is to automatically detect the mail storage format. > This option is deprecated. (we don't talk about her anymore ๐)-pโ Copy the input to the output (passthrough) and insert spam headers in the style of SpamAssassin. AnX-Spam-Statusheader is always inserted with processing details. The contents of this header always begin with either"Yes"or"No". If the input is judged to be spam, the headerX-Spam-Flag: YESis also inserted. the receipts. ๐งพโจ-vโ Be more verbose. > This option is not well supported yet. (she's trying her best okay ๐ญ)-Vโ Display version information.-hโ Display usage information. help me help you, bestie.
๐ฅ THEORY OF OPERATION ๐ฅ
bmf treats its input as a bag of tokens. Each token is checked against "good" and "bad" wordlists, which maintain counts of the numbers of times it has occurred in non-spam and spam mails. These numbers are used to compute the probability that a mail in which the token occurs is spam. After probabilities for all input tokens have been computed, a fixed number of the probabilities that deviate furthest from average are combined using Bayes's theorem on conditional probabilities. math ate. ๐งฎ๐
While this method sounds crude compared to the more usual pattern-matching approach, it turns out to be extremely effective. Paul Graham's paper A Plan For Spam: http://www.paulgraham.com/spam.html is recommended reading. (homework era but make it fun ๐)
bmf improves on Paul's proposal by doing smarter lexical analysis. In particular, hostnames and IP addresses are not discarded, and certain types of MTA information are discarded (such as message ids and dates).
MIME and other attachments are not decoded. Experience from watching the token streams suggests that spam with enclosures invariably gives itself away through cues in the headers and non-enclosure parts. Nonetheless, I would like to add the ability to decode quoted-printable and perhaps base64 encodings for textual attachments. (future update wishlist, manifesting โจ)
๐ซถ INTEGRATION WITH OTHER TOOLS ๐ซถ
Please see the /usr/share/doc/bmf/README.gz for samples and suggestions. go read it, it's lowkey good.
โญ RETURN VALUES โญ
- In passthrough mode: zero for success, nonzero for failure.
- In non-passthrough mode:
0for spam;1for non-spam;2for I/O or other errors.
memorize these, they're literally the whole plot. ๐
๐ FILES ๐
~/.bmf/goodlist.txtโ List of good tokens fortextmode.~/.bmf/spamlist.txtโ List of bad tokens fortextmode.~/.bmf/goodlist.dbโ List of good tokens forlibdbmode.~/.bmf/spamlist.dbโ List of bad tokens forlibdbmode.
๐ BUGS ๐
Only one copy ofbmf(1)instance can access the database (see options-dand-f). In Procmail recipes, ensure sequential access with a lock file:
:0 fw: bmf.lock
| bmf -p
- The lexer does not recognize multiline headers. ๐
- The lexer does not recognize MIME attachments. ๐
Content-Transfer-Encodingis not decoded. ๐
not me listing all the flaws but she's still perfect to me. ๐
๐ AUTHOR ๐
Tom Marshall <tommy@tig-grr.com>.
The Bayes algorithm is from bogofilter by Eric S. Raymond <esr@thyrsus.com>. bogofilter can be found at the bogofilter project page: http://bogofilter.sourceforge.net/.
and that's the whole page bestie!! this was BMF(1) โ you made it to the end, so proud of you, go filter some spam and slay the day away. periodt. ๐โจ๐๐ฆ๐ธ๐
๐ฆ where this page comes from
- debian bookworm: bmf 0.9.4-13 ยท GPL-2.0-or-later
- debian trixie: bmf 0.9.4-14 ยท GPL-2.0-or-later
- ubuntu jammy: bmf 0.9.4-12 ยท GPL-2.0-or-later
- ubuntu noble: bmf 0.9.4-13build2 ยท GPL-2.0-or-later
- ubuntu questing: bmf 0.9.4-14
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms