Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

snmail(8) [debian 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)

Check Out this Related Man Page

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

NAME
snsend - distribute articles snstore - store articles locally SYNOPSIS
snsend [-rvcna] snstore [-rvcna] DESCRIPTION
snsend reads articles from descriptor 0 and distributes each one into each newsgroup they are posted to, like inews. snstore does the same but stores them all locally. The input articles are expected to be in wire format (lines end with CRLF, leading dots are doubled, and articles are terminated with a lone dot). Control messages are not treated specially. The newsgroups list is taken from the X-sn-Newsgroups field if it exists; otherwise it is taken from the Newsgroups field, which must exist or the article will be junked. All fields whose names begin with X-sn- (case insensitive) are always removed. If Date or Message-ID are not present, these are created. The local hosts name is prepended to the Path field. If an article is to be junked, it is sent to the junk newsgroup if it exists, otherwise it is discarded. ROUTING
This applies only to snsend. snstore does not route; it treats all news.groups as though they were local (see Nonexistent newsgroup and Local newsgroup below). If any of the following fails, snsend aborts: For each news.group an article is (cross-) posted to, snsend routes the article as follows, aborting if any action fails: Nonexistent newsgroup If /var/spool/sn/news.group is not a directory, snsend ignores this news.group. If all news.groups are thus ignored, the article is junked. Global newsgroup If /var/spool/sn/news.group/.outgoing is a (symlink to a) directory, snsend stores the article into a file in that directory, if the same article does not already exist there (so news.group's upstream feed doesn't get multiple copies of the same article.) Such in- transit article files are given names that begin with a $ sign. Local processing via script Otherwise if /var/spool/sn/news.group/.outgoing is a regular file, it is taken to be a script or program and is run with the article available on its input. See /var/spool/sn/dot-outgoing.ex. Local processing via fifo Otherwise if /var/spool/sn/news.group/.outgoing is a fifo, the article is written into it. It is an error if nothing is reading the fifo. Local newsgroup Otherwise if /var/spool/sn/news.group/.outgoing does not exist, the article is stored into news.group. OPTIONS
Options apply to snsend and snstore equally. -r The article stream is in rnews batch format, rather than wire format. Only the #! rnews form is understood. -c If an article already exists in the local newsgroup it is destined for, don't store it there. For snsend, this option has no effect on newsgroups that are not local. -a (Aliases not allowed.) When storing to multiple local newsgroups, do not alias subsequent copies to the first, instead, make a copy. Aliasing saves disk space, but when the original expires, so do all aliases to it. This option has no effect on newsgroups that are not local. -n Don't actually do anything with the article, just dump it back onto descriptor 1. -v For each article stored in each newsgroup, output a line to descriptor 1 similar to what snscan would emit, except that for non- local newsgroups the serial number will always be 0. FILES
/var/spool/sn/news.group.name/ This includes /var/spool/sn/=junk newsgroup if it exists. Each such directory represents the newsgroup of the same name, and arti- cles are stored in files 1, 2, 3, etc. beneath it. Each such file contains 1 or more articles. This is contrary to the traditional form of /var/spool/sn/news/group/name. news.group.name. /var/spool/sn/news.group/.outgoing See also ROUTING above. The presence of this directory indicates that news.group is global, and articles posted to news.group end up here in files named $*. These files are linked in already complete, so all such files are ready to be uploaded. /var/spool/sn/news.group/.compress If this file exists, articles stored in news.group are candidates for compression. The content of the file is a number representing a minimum article body size below which compression won't be applied. If the file is empty this threshold defaults to 1024 bytes. /var/spool/sn/.me If this file exists, it's contents are taken to be the local hosts name for purposes of the Path field. Otherwise the name is obtained from gethostname(2). ENVIRONMENT VARIABLES
See also /usr/sbin/dot-outgoing.ex for other variables exported when snsend invokes a .outgoing program. SNROOT If this is set, its value is used in place of /var/spool/sn. EXIT CODES
snsend and snstore exit 0 on success, 1 on usage error, 2 on system error, 3 on article format error, and 9 if /var/spool/sn/news.group/.outgoing (snsend only) exits with other than 0. SEE ALSO
/usr/sbin/dot-outgoing.ex, snscan(1) N.B. Harold Tay snsend,v0.3.8(8)
Man Page