Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

applyfilter(8) [debian man page]

applyfilter(8)						      System Manager's Manual						    applyfilter(8)

NAME
applyfilter - apply filter settings to news spool SYNOPSIS
applyfilter [-v] ... newsgroup DESCRIPTION
Leafnode is a USENET package intended for small sites, where there are few users and little disk space, but where a large number of groups is desired. Applyfilter is the program to apply filter settings to your newsspool, particularly after changes that were not in effect at the time the articles were downloaded with fetchnews. Applyfilter is used if you want to remove postings from your spool matching a certain filter pat- tern (see FILES below). If the headers of an article match any of the filtering rules, the article is being deleted from the newsgroup. Applyfilter sets its real and effective uid to "news". OPTIONS
-v Be verbose. newsgroup is the newsgroup you want to apply the filter to. FILES
A file specified in the filterfile option of /etc/news/leafnode/config contains the set of filtering rules that are applied to the newsspool. Each rule must be on a separate line. Empty lines and comments (marked by a # which MUST be at the beginning of the line) are allowed and will be ignored. Each line contains a regular expression that will be compiled with the PCRE_MULTILINE option set (unless it is a comment line or an empty line). Every regular expression applied to the whole message header (folded message headers are unfolded before the match is attempted). If any regular expression matches the header, the posting gets removed. For example, the following set of rules will delete all crosspost- ings to alt.flame. ^Newsgroups:.*[, ]alt.flame$ ^Newsgroups:.*[, ]alt.flame, ^Newsgroups: indicates that the pattern should only be applied to the Newsgroups: header. After the header, an arbitrary number of charac- ters 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). 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. Note that some leafnode programs (such as fetchnews) feed the header line by line to the regexp (after unfolding), others (such as apply- filter) 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're trying to match multiple headers in the same regexp -- this would work with applyfilter, but not with fetchnews. 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. 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-96 Troll Tech AS, Postboks 6133 Etterstad, 0602 Oslo, Norway, fax +47 22646949. SEE ALSO
pcrepattern(3), leafnode(8), fetchnews(8), texpire(8). leafnode 1.11.8 applyfilter(8)

Check Out this Related Man Page

snmail,v0.3.8(8)					      System Manager's Manual						  snmail,v0.3.8(8)

NAME
snmail - mail-to-news filter SYNOPSIS
snmail [-sP] [listname [prefix]] DESCRIPTION
snmail reads a single email message on standard input, and writes the converted message to standard output. This output is suitable for feeding to snstore. snmail does these conversions: If the first line is a UUCP From_ line, it is silently discarded; a Newsgroups: line is added with the value of prefixlistname (prefix concatenated with listname), and other existing Newsgroups: lines are removed; and a Path: line is created from all Received: lines, which are removed; all header lines are unfolded; if no message ID exists, one is created; message IDs in all Refer- ences: lines and In-Reply-To: lines are collected into a single References: line; all lines are rewritten to end in CRLF; and a lone . on a line is written at the end of the message. snmail will accept and pass on messages with invalid header fields. snmail is meant to be run from a .forward or the /etc/aliases file (if you're using sendmail or similar) or from a .qmail file (if you're using qmail). snmail may write status or error messages to standard error. OPTIONS
-s Pipe output to snstore directly, do not write to standard output. This is so the exit status is not lost in a shell pipeline. If you use this flag, it is also a good idea to also use -c (tell snstore to check if article already exists). Other options snmail also accepts options intended for snstore, viz. -c, -v, and -n, and these are passed on uninterpreted. ARGUMENTS
prefix is the prefix of the newsgroup; if not specified, it defaults to local. (note the trailing .). prefix may not begin with a . (dot) but it may be empty. listname completes the newsgroup name; if not specified, it is the local part of the address in the Return-Path: line if it exists and isn't empty; otherwise it is the local part of the messages' first From:. So if the message originated from the list <linux-lem- mings@vger.rutgers.edu>, then the default newsgroup becomes local.linux-lemmings. listname may be empty if prefix isn't. You may want to have a file /var/spool/sn/prefixlistname/.nopost to deny posting from all and sundry, to prevent the mailing list newsgroup from being contaminated. prefix and listname may contain uppercase characters; these are converted to lower case. USAGE
There are two ways of forwarding mail to the sn news spool: directly from a user's mail address; or forwarded to a central address and then invoking snmail. The central concern here is permissions; while anyone can run snmail, not everyone may store mail in the spool. Mail setups vary a lot, so basically you're on your own here. ENVIRONMENT VARIABLES
SNROOT If this is set and is not empty, the value is used in place of /var/spool/sn, the default news spool directory. PATH If -s was specified, determines where to look for snstore, before looking in /usr/sbin. EXIT STATUS
snmail exits 0 if the message was successfully converted and written, or if the message ID already exists in the ID database and the mes- sage was not stored or converted. snmail exits with 1 on usage error, 2 on operational error, 3 if the mail message wasn't in the proper format. N.B. Harold Tay snmail,v0.3.8(8)
Man Page