1applyfilter(8) System Manager's Manual applyfilter(8)
2
3
4
6 applyfilter - apply filter settings to news spool
7
8
10 applyfilter [-v] ... newsgroup
11
12
14 Leafnode is a USENET package intended for small sites, where there are
15 few users and little disk space, but where a large number of groups is
16 desired.
17
18 Applyfilter is the program to apply filter settings to your newsspool,
19 particularly after changes that were not in effect at the time the
20 articles were downloaded with fetchnews. Applyfilter is used if you
21 want to remove postings from your spool matching a certain filter pat‐
22 tern (see FILES below). If the headers of an article match any of the
23 filtering rules, the article is being deleted from the newsgroup.
24
25 Applyfilter sets its real and effective uid to "news".
26
27
29 -v Be verbose.
30
31 newsgroup
32 is the newsgroup you want to apply the filter to.
33
34
36 A file specified in the filterfile option of /etc/leafnode/config con‐
37 tains the set of filtering rules that are applied to the newsspool.
38 Each rule must be on a separate line. Empty lines and comments (marked
39 by a # which MUST be at the beginning of the line) are allowed and will
40 be ignored.
41
42 Each line contains a regular expression that will be compiled with the
43 PCRE_MULTILINE option set (unless it is a comment line or an empty
44 line). Every regular expression applied to the whole message header
45 (folded message headers are unfolded before the match is attempted).
46 If any regular expression matches the header, the posting gets removed.
47 For example, the following set of rules will delete all crosspostings
48 to alt.flame.
49
50 ^Newsgroups:.*[, ]alt.flame$
51 ^Newsgroups:.*[, ]alt.flame,
52
53 ^Newsgroups: indicates that the pattern should only be applied to the
54 Newsgroups: header. After the header, an arbitrary number of characters
55 may follow, ending in either a comma or a space. After that, alt.flame
56 must be in the line, either at the end of the line (first entry) or in
57 the middle of the line, followed by other newsgroups (second entry).
58
59 Unfortunately, regular expressions are a complex matter and outside the
60 scope of this document. Please see the manual pages provided with the
61 PCRE library for details.
62
63 Note that some leafnode programs (such as fetchnews) feed the header
64 line by line to the regexp (after unfolding), others (such as applyfil‐
65 ter) feed the whole header in one large blob. This does not usually
66 matter because patterns are compiled in multiline mode, but will matter
67 if you're trying to match multiple headers in the same regexp -- this
68 would work with applyfilter, but not with fetchnews.
69
70
72 LN_LOCK_TIMEOUT
73 This variable is parsed as an unsigned integer value and deter‐
74 mines how many seconds applyfilter will wait when trying to
75 obtain the lock file from another leafnode program. 0 means to
76 wait indefinitely. This variable takes precedence over the con‐
77 figuration file.
78
79
81 Copyright 1999 by Cornelius Krasel <krasel@wpxx02.toxi.uni-
82 wuerzburg.de>.
83 Copyright 2002 - 2006 by Matthias Andree <matthias.andree@gmx.de>.
84
85 Leafnode was originally written by Arnt Gulbrandsen <agulbra@troll.no>
86 and is copyright 1995-96 Troll Tech AS, Postboks 6133 Etterstad, 0602
87 Oslo, Norway, fax +47 22646949.
88
89
91 pcrepattern(3), leafnode(8), fetchnews(8), texpire(8).
92
93
94
95leafnode 1.11.5 applyfilter(8)