1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
.TH snmail,v!!VERSION!! 8 "Harold Tay" "N.B." \" -*- nroff -*-
.SH NAME
snmail \- mail-to-news filter
.SH SYNOPSIS
.B snmail
.RI [\- sP ]
.RI [ listname
.RI [ prefix ]]
.br
.SH DESCRIPTION
.B snmail
reads a single email message on standard input, and writes the
converted message to standard output.
This output is suitable for feeding to
.BR snstore .
.B snmail
does these conversions:
If the first line is a UUCP
.B From_
line, it is silently discarded;
a
.BR Newsgroups :
line is added with the value of
.I prefixlistname
.RI ( prefix
concatenated with
.IR listname ),
and other existing
.BR Newsgroups :
lines are removed;
and a
.BR Path :
line is created from all
.BR Received :
lines, which are removed;
all header lines are unfolded;
if no message ID exists, one is created;
message IDs in all
.B References:
lines and
.BR In-Reply-To :
lines are collected into a single
.B References:
line; all lines are rewritten to end in CRLF; and a lone
.B .
on a line is written at the end of the message.
.B snmail
will accept and pass on messages with invalid header fields.
.B snmail
is meant to be run from a
.B .forward
or the
.B /etc/aliases
file (if you're using sendmail or similar) or from a
.B .qmail
file (if you're using qmail).
.B snmail
may write status or error messages to standard error.
.SH OPTIONS
.TP
.RI \- s
Pipe output to
.B 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
.RI \- c
(tell
.B snstore
to check if article already exists).
.TP
Other options
.B snmail
also accepts options intended for
.BR snstore ,
viz.
.RI \- c ,
.RI \- v ,
and
.RI \- n ,
and these are passed on uninterpreted.
.SH ARGUMENTS
.TP
.I prefix
is the prefix of the newsgroup; if not specified, it defaults to
.B local.
(note the trailing
.BR . ).
.I prefix
may not begin with a
.B .
(dot) but it may be empty.
.TP
.I listname
completes the newsgroup name; if not specified, it is the local part
of the address in the
.B Return-Path:
line if it exists and isn't empty; otherwise it is the local part of
the messages' first
.BR From: .
So if the message originated from the list
.RB < linux-lemmings @vger.rutgers.edu>,
then the default newsgroup becomes
.BR local.linux-lemmings .
.I listname
may be empty if
.I prefix
isn't.
You may want to have a file
.RB !!SNROOT!!/ prefixlistname /.nopost
to deny posting from all and sundry, to prevent the mailing list
newsgroup from being contaminated.
.I prefix
and
.I listname
may contain uppercase characters; these are converted to lower case.
.SH 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
.BR snmail .
The central concern here is permissions; while anyone can run
.BR snmail ,
not everyone may store mail in the spool. Mail setups vary a lot,
so basically you're on your own here.
.SH ENVIRONMENT VARIABLES
.TP
.B SNROOT
If this is set and is not empty, the value is used in place of
.BR !!SNROOT!! ,
the default news spool directory.
.TP
.B PATH
If
.RI \- s
was specified, determines where to look for
.BR snstore ,
before looking in !!BINDIR!!.
.SH EXIT STATUS
.B snmail
exits 0 if the message was successfully converted and written,
.B or
if the message ID already exists in the ID database and the message
was not stored or converted.
.B snmail
exits with 1 on usage error, 2 on operational error, 3 if the
mail message wasn't in the proper format.
|