FILTER(1)
๐ FILTER(1) โ the girlies' guide to filtering ur mail ๐
okay bestie, so this is a page from the General Commands Manual, and it's about a lil program called filter. sit down, hydrate, we're doing this ๐ซถ
โจ NAME โจ
filter โ filter incoming messages before adding to mailbox
like, it's the bouncer at the door of ur inbox. it checks the vibes of every message before letting it in ๐
โจ SYNOPSIS โจ
filter [-q] [-v] [-l] [-o output] [-f rules-file] [-m mailbox]
filter [-n] [-f rules-file]
filter [-r] [-o output] [-f rules-file]
filter [-c] [-s] [-o output] [-f rules-file]
filter [-c] [-S] [-o output] [-f rules-file]
five whole moods, pick ur fighter โจ
โจ DESCRIPTION โจ
so the tl;dr โ filter is literally designed to sort ur incoming mail based on user preferences for various recognized headers. it logs a summary of messages filtered to a logfile. that's the vibe check. ๐ฌ
for the full tea, scroll down to the USAGE section, because there's a LOT there and it's honestly iconic.
โจ OPTIONS โจ
these are the flags filter understands, no cap:
-cโ Clear logs. if u use this flag, the log files get removed after being summarized by either-sor-S(peep below). so like, summarize first, THEN yeet ๐๏ธ-frules-file โ get ur rules from the specified file instead of the default$HOME/.filter/filter-rules. custom rules, custom vibes ๐-lโ Log actions only. do NOT log info about mailed messages. we're keeping it minimal bestie-nโ Not really. output what would happen if given a message from standard input, but don't actually do anything with it. it's giving window shopping ๐๏ธ-ofile โ redirect stdout messages to the specified file or device. logging of filter actions is not affected. (this was added to more gracefully deal with changes in the file system, sincesendmailis quite picky about modes of files being redirected into.) picky king ๐-mmailbox โ override the compiled in definition of ur primarymailbox. this is disabled if filter is setgid. sorry bestie, security said no-qโ Quiet. do not log filtering actions. shhhh ๐คซ-rโ Rules. list the rules currently being used. receipts, basically ๐งพ-sโ Summarize. list a summary of the message filtering log-Sโ same as-sbut ALSO includes message-by-message information. extra detail, extra slay โจ-vโ Verbose. give output on standard out for each message filtered. may be useful to set output to/dev/consoleor other logging device. (see-o). she's chatty and we love her ๐ฃ๏ธ
โจ USAGE โจ
okay this is the main character section, lock in ๐ฅ
filter uses a set of selection rules to process incoming mail messages. these rules are normally read in from $HOME/.filter/filter-rules. as soon as a rule matches something about the message, that rule is used, and no further action is taken โ first match wins, periodt. the general format for a rule is:
if (expression) then action
where expression is:
expression ::= { not } condition { and expression }
condition ::= field = stringvalue
::= field != stringvalue
::= lines relop numvalue
or ::= always
these further break down as:
field ::= from | subject | alphasubject | to | lines | sender
relop ::= = | != | < | > | <= | >=
stringvalue ::= any quoted string
numvalue ::= any integer value
note: alphasubject is a transformed version of the subject line, where only alpha chars are preserved, and they are forced to lower case. it is then simpler to use a regular expression match across a wide variety of similar subjects. she's a glow-up of the subject line fr fr โจ
from matches any and all of the following headers:
"From " From: Reply-To: Sender:
so from is not just one thing, it's a whole friend group ๐
Action can be any of:
delete (ignore this message; throw it away)
save foldername (put in 'foldername' for later)
savecopy foldername (save a copy AND put in my inbox)
execute command (pipe message to 'command')
executec command (copy to inbox, AND pipe to 'command')
forward address (forward this message)
forwardc address (forward this message, AND copy to inbox)
resend address (resend to new addr without change)
leave (just put it in my inbox)
bounce (say there's no such user)
an example of a rules file would be:
# I'll read this stuff later when I feel like it
if (from = "list@interest.org") then save "~/Mail/mailinglist"
# This mailing list actually has an x-mailing-list header
if (mailinglist = "smartlist@other.com") then save "~/Mail/otherlist"
# auto-archive this project's email, AND put in my current mailbox
if (subject = "strange project") then savecopy "~/Mail/proj-archive"
# If "make money" appears ANYWHERE in subject, upper/lowercase,
# delete the lousy spam
if ( subject = "make money" ) then delete
# This person no longer shares this virtual mailbox with me.
# Resend visibly as a "forwarded" message.
if (to = "partner") then forward "partner@new.address.com"
# If email for an old address comes to me, resend to new one.
# Note that the "envelope" will show my address, but the
# normal headers will not
if ( to = "old_address" ) then resend new@address.here"
# Special virtual headerline derived from normal subject line
# catches "multiple!!!wor+ds**here"
if ( alphasubject = "multiplewordshere" ) then delete
# If email for a special address comes to me, resend through
# a non-standard "special" mailer
if ( to = "special_address" ) then exec "/usr/lib/mailer special@addr"
#
# The rules file doesn't really need parentheses. Or even the 'if'.
# They are just traditional.
subject = "silly" then bounce
note that all filenames must be double-quoted โ yes, all of them, no exceptions bestie ๐
for further information about the rules language, please see The Elm Filter Guide.
โจ MAINTAINER โจ
Philip Brown ๐
โจ FILES โจ
$HOME/.filter/filter-rulesโ default rules file ๐$HOME/.filter/filterlogโ a log of what has been done$HOME/.filter/filtersumโ a summary of what has been done$MAILโ if you set this var, defines ur default mailbox ๐ฎ/etc/passwdโ used to get users home directory
โจ SEE ALSO โจ
โจ COMMENTS โจ
ngl it could be smarter about pattern matching ๐ญ message body checks might be nice too. we're manifesting it bestie ๐ฏ๏ธ
please note that this was historically bundled with the elm mail reader, but now can be found at http://www.bolthole.com/filter/ โ glow up era ๐
โจ BUG REPORTS TO โจ
filter@bolthole.com โ tell them everything, they wanna know ๐
โจ COPYRIGHTS โจ
Copyright 1988-1992 by The USENET Community Trust
Derived from Elm 2.0, Copyright 1986, 1987 by Dave Taylor
and that's the whole page, bestie ๐ USENET Comm. Trust, 19 April 2004, page FILTER(1) โ mwah, go filter ur mail, u got this ๐๐ฆโจ
๐ฆ where this page comes from
- debian bookworm: filter 2.6.3+ds1-3+b1 ยท Elm
- debian trixie: filter 2.6.3+ds1-5 ยท Elm
- ubuntu jammy: filter 2.6.3+ds1-3 ยท Elm
- ubuntu noble: filter 2.6.3+ds1-3build1 ยท Elm
- ubuntu questing: filter 2.6.3+ds1-5
- ubuntu resolute: filter 2.6.3+ds1-6 ยท Elm
- ubuntu stonking: filter 2.6.3+ds1-7 ยท Elm
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms