man mail2news (Commandes) - feed a mail message into Usenet news
NAME
mail2news - feed a mail message into Usenet news
SYNOPSIS
mail2news [ -. ] [ -F ] [ -=program ] [ -nnewsgroups ] [ -oorganization ] [ -ddistribution ] [ -aapproval ] [ -xpath ] [ inewsflags ]
DESCRIPTION
Mail2news reads an RFC822 Mail message on standard input, writes the headers to conform with RFC1036 (superceeding RFC850) Usenet News article. A subject is required, unless one of the inews(8) ``-x'' or ``-o'' flags are specified.
If the ``-.'' flag is specified, the modified article is sent to the standard output, rather than feed into inews.
By default, mail2news sends its input to ``inews -h''; this can be changed by using the ``-='' flag, which will send the output to the specified program. Note that no argument parsing is done, so that only a single word may be specified with the ``-='' flag.
The ``-o,'' ``-n,'' ``-d,'' ``-a,'' or ``-x'' flags may be used to specify the Organization, Newsgroups, Distribution, Approved, or Path header in the message. Note that unlike the inews parallels of these flags, the ``-n'' flag overrides any Newsgroups header that might appear in the message, while the other flags specify defaults if the message does not have the headers. In addition, as a concession to sendmail(8) alias processing the argument to the ``-o'' flag is handled specially. Since many sendmail.cf files do not have the ``preserve case'' flag on for the ``prog'' mailer, a period in the argument means that the following character should be converted to uppercase; two periods mean to output a single period. For example, if the following line is in /etc/aliases(5): post-news-admin: "|/usr/bin/mail2news -o '.the .b...b...n.. .gateway' -n news.admin" then messages to mailed to post-news-admin will be posted to the ``news.admin'' newsgroup with the following header line: Organization: The B.B.N. Gateway
If the ``-F'' flag is given, then mail2news will try to filter out the ``please add me to your mailing list'' messages often sent by network neophytes. This is done by looking for short messages which have words like subscribe in them.
Mail2news can modify the newsgroups an article is sent to, based on regular expressions found in the ``Title:'', ``Keywords:'', and ``Summary:'' headers. The headers are scanned once for each newsgroup the article is originally destined for, provided a mapping file exists for the newsgroup. (The path to the mapping file depends on a compile-time parameter.) For example, if a mail message is to be sent to talk.foo and soc.bar, mail2news will scan the headers twice. If the file /usr/lib/news/.admin/talk.foo (or /var/spool/news/talk/foo/recnews.cmd) exists, the commands in that file are interpreted. The scan is repeated, with the appropriate file for soc.bar. In the explanation below, the ``current newsgroup'' will be first talk.foo and then soc.bar.
Blank lines, and lines beginning with a pound sign (#) are ignored. Other lines should like like this: delim pattern delim command whitespace [arg] The delim can be any character; if it appears in the pattern, it should be preceeded by a backslash (\). The pattern is an ``ed(1)-style'' regular expression, as detailed in the regex(3L) manual page. The command is a single letter from the set [adkmq], and is described below. The whitespace is, obviously, any combination of spaces and tabs. Finally, the optional arg should be a comma-separated list of newsgroups to be acted on by the command.
The valid commands are:
a Add All newsgroups in the arg are added d Delete The current group is deleted from the article k Kill The article is returned, and arg is given as a contact name m Move The current group is deleted and the arg group is added q Quiet kill The article is quietly ignored
For example, here is a fragment from the mapping file for a local.bboard newsgroup:
# Move seminars and talks /seminar/m local.seminars,region.seminars /lecture/m local.seminars,region.seminars # Move housing requests /housing/m local.housing /apartment/m local.housing # Kill flames /flame/k the anti-flame society /jerk/q @placeholder # Copy machine downtime announcements /downtime/a local.config,news.config # If you want something, it's not forsale /want/a local.wanted /want/d @placeholderThe last two lines show how one might tweak cross-posts, if the mapping file were for a local.wanted newsgroup.
DIAGNOSTICS
Almost all return values from system calls and standard I/O library routines are checked. If anything goes wrong, a diagnostic message is sent to standard error, where it will presumably be picked up by sendmail (or other mail-processing program) and returned to the originator, who will in turn be confused because she doesn't know anything at all about this gateway program.
FILES
uucp-2-inet Mapping of ``Path:'' names to Internet hostnames.
inews News delivery program.
The full paths to these files are compile-time constants; see
gate.h
in the source for the exact details.
SEE ALSO
AUTHORS
Rich $alz <rsalz@bbn.com>, after
nrecnews
by
Erik E. Fair <fair@apple.com>.
Ozan Yigit <yunexus!oz> wrote the regular-expression routines.