applyfilter(8)

πŸ“¦
version 1.12.0 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… applyfilter β€” the system manager's little helper

okay bestie, so this is applyfilter(8), a page straight out of the System Manager's Manual, and it's about applying your filter settings to the news spool. yeah. that. let's get into it πŸŽ€


✨ NAME ✨

applyfilter β€” apply filter settings to news spool

like... it applies your filter settings. to the news spool. that's the whole vibe πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

applyfilter [-v] ... newsgroup

🌸 DESCRIPTION 🌸

okay so first, context: Leafnode is a USENET package built for small sites β€” think few users, not a lot of disk space, but a huge number of groups desired. it's giving cozy-but-ambitious 🫢

Applyfilter is the program that applies your filter settings to your newsspool. specifically? it's the one you run after changes that weren't in effect back when the articles got downloaded with fetchnews. yeah, the "oops I changed my rules after the fact" cleanup era πŸ™ˆ

so if you want to remove postings from your spool that match a certain filter pattern (peep FILES below, bestie), this is your girl. and here's the tea: if the headers of an article match any of the filtering rules, that article is being deleted from the newsgroup. not hidden. not archived. deleted. periodt πŸ’€

also important, no cap: Applyfilter sets its real and effective uid to "news". iconic behavior, honestly πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • -v β€” Be verbose. spill the details, girl ✨
  • newsgroup β€” is the newsgroup you want to apply the filter to. just the one, babe πŸŽ€

πŸ’– FILES πŸ’–

A file specified in the filterfile option of /etc/news/leafnode/config contains the set of filtering rules that get applied to the newsspool. so that's where the lore lives πŸ“œ

Each rule must be on a separate line. Empty lines and comments are allowed and will be ignored β€” and the comment marker is a # which MUST be at the beginning of the line. like, beginning. not "somewhere in there". beginning. iykyk πŸ’…

Each line contains a regular expression that will be compiled with the PCRE_MULTILINE option set (unless it's a comment line or an empty line, obviously). Every regular expression is applied to the whole message header β€” and folded message headers are unfolded before the match is attempted. and if any regular expression matches the header, the posting gets removed. bye bestie πŸ‘‹

for example, the following set of rules will delete all crosspostings to alt.flame:

^Newsgroups:.*[, ]alt.flame$
^Newsgroups:.*[, ]alt.flame,

let's break that down, because it's lowkey elegant:

^Newsgroups: indicates that the pattern should only be applied to the Newsgroups: header. after the header, an arbitrary number of characters may follow, ending in either a comma or a space. after that, alt.flame must be in the line β€” either at the end of the line (first entry) or in the middle of the line, followed by other newsgroups (second entry). see? ate. πŸ”₯

Unfortunately, regular expressions are a complex matter and outside the scope of this document. Please see the manual pages provided with the PCRE library for details. (ngl, regex lore goes deep. i can't be your only source, bestie πŸ₯²)

not me having to say this part: some leafnode programs (such as fetchnews) feed the header line by line to the regexp (after unfolding), others (such as applyfilter) feed the whole header in one large blob. This does not usually matter because patterns are compiled in multiline mode, but will matter if you are trying to match multiple headers in the same regexp β€” this would work with applyfilter, but not with fetchnews. so if your multi-header regex is acting brand new in fetchnews, that's why πŸ’€

🌈 ENVIRONMENT 🌈

  • LN_LOCK_TIMEOUT β€” This variable is parsed as an unsigned integer value and determines how many seconds applyfilter will wait when trying to obtain the lock file from another leafnode program. 0 means to wait indefinitely. This variable takes precedence over the configuration file. so if you're sitting there like "why is it just waiting" β€” it's probably this πŸ•°οΈβœ¨

πŸ‘‘ AUTHOR πŸ‘‘

Copyright 1999 by Cornelius Krasel <krasel@wpxx02.toxi.uni-wuerzburg.de>.

Copyright 2002 – 2006 by Matthias Andree <matthias.andree@gmx.de>.

Leafnode was originally written by Arnt Gulbrandsen <agulbra@troll.no> and is copyright 1995 – 1996 Troll Tech AS, Postboks 6133 Etterstad, 0602 Oslo, Norway, fax +47 22646949.

(legends. all of them. absolute main character energy πŸ«ΆπŸ’œ)


⭐ SEE ALSO ⭐

pcre2pattern(3), leafnode(8), fetchnews(8), texpire(8).

go read those too, bestie, they're the extended universe 🌸


and that's the whole page! this lil number lives in leafnode 1.12.0, on the applyfilter(8) page, dated way back with the system manager's manual crew β€” mwah, go filter something responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from