IFILE(1)
π IFILE(1) β the manual page, but make it make sense π
okay bestie, gather round, because this is the manual page for ifile from section 1 of the user commands, and honestly? it's giving main character energy for a mail filter. let's get into it. π¦
β¨ NAME β¨
ifile β the core executable for the ifile mail filtering system. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
ifile [-b file] [-q|-Q] [-g] [-k] [-o] [-v num] [lexing options] file
...
ifile -c -q|-Q [-T threshold] [-b file] [-g] [-k] [-o] [lexing options]
file ...
ifile [-b file] [-d folder] [-i folder|-u folder] [-g] [-k] [-o] [-v
num] [lexing options] file ...
ifile -r [-b file]
so yeah, there's four whole shapes this command can take and yes you need to pick the right one, no cap. π«Ά
π DESCRIPTION π
ifile is a mail filter client that uses machine learning to classify e-mail into folders/mail boxes. it's literally an AI sorting your inbox before that was even a cool thing to do. π
the algorithm it uses is called Naive Bayes. and okay, "naive" is a rough name but basically it considers each document an unordered collection of words, and then it classifies by matching the document distribution with the most closely matching folder/mailbox distribution. it's like a vibe check but for word frequency, and it slays. β¨
π OPTIONS π
-b,--db-file=fileβ where to read/store the ifile database. default is~/.idata, which is where your whole personality lives now. π-c,--conciseβ equivalent of"ifile -v 0 | head -1 | cut -f1 -d". must be used with-qor-Q. non-negotiable bestie.-d,--delete=folderβ deletes the statistics for each of the files from the category folder.-f,--folder-calcs=folderβ shows the word-probability calculations for folder. peek behind the curtain, iconic behavior.-g,--log-fileβ creates and stores debugging information in~/.ifile.log.-i,--insert=folderβ adds the statistics for each of the files to the category folder.-k,--keep-infrequentβ leaves in the database words that occur infrequently (normally they are tossed). hoarding, but make it data. π-l,--query-loocv=folderβ for each of the files, temporarily removes file from folder, performs query and then reinserts file in folder. the database is not modified. (loocv = leave-one-out cross-validation, iykyk)-o,--occurβ uses document bit-vector representation. counts each word once per document.-q,--queryβ outputs rating scores for each of the files.-Q,--query-insertβ for each of the files, outputs rating scores and adds statistics for the folder with the highest score. queen of doing two things at once. π-T,--threshold=thresholdβ okay this one has lore, pay attention:- when used with both
-cand-q, it outputs the two highest ranking categories if their score differs by at most threshold / 1000, which can be used to detect border cases. - when used with
-qonly and any threshold > 0, it outputs the score difference percentage. - for example,
- when used with both
ifile -T1 -q foo.txt
might result in
spam -15570.48640776
non-spam -18728.00272369
diff[spam,non-spam](%) 9.21
if so, then
ifile -T93 -q -c foo.txt
will result in
foo.txt spam,non-spam
whereas
ifile -T92 -q -c foo.txt
will result in
foo.txt spam
-r,--reset-dataβ erases all currently stored information. β οΈ everything. gone. this is the "delete the whole group chat" button, so be so fr before you press it.-u,--update=folderβ same as 'insert' except only adds stats if folder already exists.-v,--verbosity=numβ amount of output while running:0=silent,1=quiet,2=progress,3=verbose,4=debug.
π Lexing options:
-a,--alpha-lexerβ lex words as sequences of alphabetic characters (this is the default, bestie).-A,--alpha-only-lexerβ only lex space-separated character sequences which are composed entirely of alphabetic characters.-h,--strip-headerβ skip all of the header lines exceptSubject:,From:andTo:.-m,--max-length=charβ ignore portion of message after first char characters. use the entire message if char is set to0. default is50,000.-p,--print-tokensβ just tokenize and print, don't do any other processing. documents are returned as a list of word, frequency pairs.-s,--no-stoplistβ do not throw out overly frequent (stoplist) words when lexing.-S,--stemmingβ use 'Porter' stemming algorithm when lexing documents.-w,--white-lexerβ lex words as sequences of space separated characters.
if no files are specified on the command line, ifile will use standard input as its message to process. keyboard girlies rise up. β¨οΈπ
-?,--helpβ give this help list.--usageβ give a short usage message.-V,--versionβ print program version.
mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. (yes, that's a real sentence, and yes it's important.) π«‘
π¦ FILES π¦
~/.idataβ the ifile database (default location). see the FAQ included in the ifile package for description of database format.
π AUTHOR π
Jason Rennie <jrennie@csail.mit.edu> and many others. see the ChangeLog for the full list. shoutout to the whole squad. π«Ά
π EXAMPLES π
okay so before using ifile, you need to train it. let's say that you have three folders, "spam", "ifile" and "friends", and the following directory structure:
/--+--spam----+--1
| +--2
| +--3
|
+--ifile---+--1
| +--2
| +--3
|
+--friends-+--1
+--2
+--3
the following commands build the ifile database in ~/.idata (use the -d option to specify a different location for the database):
ifile -h -i spam /spam/*
ifile -h -i ifile /ifile/*
ifile -h -i friends /friends/*
the -h option strips off headers besides "Subject:", "From:" and "To:". i find that -h improves ifile's performance, but you may find otherwise for your personal collection.
note that we have made the argument to -i the same as the corresponding folder name. this is not necessary. the argument to -i can be any word you want to use to identify a category of e-mails. the argument to -i must not include space characters (including tab, feedline, etc.).
at this point, your ~/.idata file should look something like this:
spam ifile friends
662 1020 6451
3 3 3
jrennie 9 0:3 1:18 2:16
mindspring 6 1:7 2:5
make 9 0:5 1:3
yahoo 9 0:1 1:22 2:2
the first line is the space-separated list of folders. their ordering specifies a numbering (spam=0, ifile=1, friends=2). the second line is a token count for each folder (e.g. 662 tokens observed in the three spam messages). the third line is an e-mail count for each folder (e.g. 3 e-mails for each of spam, ifile and friends). each following line specifies statistics for a word. the format of a line is
word age folder:count [folder:count ...]
where folder is the folder number determined by the first line ordering. folders with a count of zero are not listed. so, the line beginning with "jrennie" indicates that "jrennie" appeared 3 times in "spam" e-mails, 18 times in "ifile" e-mails and 16 times in "friends" e-mails. the age is the number of e-mails that have been processed since the word was added to the database. very infrequent words are pruned from the database to keep the database size down.
now that you have a database, you might want to filter some e-mails. say you have the following incoming e-mails:
/--inbox--+--1
+--2
+--3
to find out what folders ifile thinks these e-mails belong in, run
ifile -c -q /inbox/1
ifile -c -q /inbox/2
ifile -c -q /inbox/3
let's say that 1 is about ifile, 2 is spam and 3 is from a friend. assuming ifile does its job correctly, you'll see output like this:
/inbox/1 ifile
/inbox/2 spam
/inbox/3 friends
with such little training data, ifile is unlikely to get the labels correct, but you should get the idea :-) (yes the :-) is in the original, i'm not adding it, it's canon π₯Ή)
now, if you move the e-mails to the folders suggested by ifile, you'll want to update the database accordingly. you can do this with the -i option, like before. or, you can simply use -Q in place of -q above. this automatically adds the e-mail to the folder ifile suggests.
now, assume for a moment that e-mail 1 was actually spam. we've added 1 to ifile and put it in the ifile folder. we need to move it to the spam folder and update the ifile database accordingly. we can update the database with the following command:
ifile -d ifile -i spam /inbox/1
this deletes the e-mail from "ifile" and adds it to "spam". chef's kiss, fixed. π
π SEE ALSO π
examples of how to use ifile together with procmail(1) and metamail(1) can be found in the directory /usr/share/doc/ifile/examples. go look, bestie, the lore is there. πβ¨
and that's the whole page, no cap. you're a certified ifile girlie now. periodt. π
this has been ifile version 1.3.4, dated November 2004 β yes, november 2004, the manpage is literally older than some of us and still eating. π«Άπ
π¦ where this page comes from
- debian bookworm: ifile 1.3.9-8 Β· LGPL-2.0-or-later
- debian trixie: ifile 1.3.9-9 Β· LGPL-2.0-or-later
- ubuntu jammy: ifile 1.3.9-7 Β· LGPL-2.0-or-later
- ubuntu noble: ifile 1.3.9-8 Β· LGPL-2.0-or-later
- ubuntu questing: ifile 1.3.9-9
- ubuntu resolute: ifile 1.3.9-10 Β· LGPL-2.0-or-later
- ubuntu stonking: ifile 1.3.9-10 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms