snmail,v0.3.8(8) | System Manager's Manual | snmail,v0.3.8(8) |
snmail - mail-to-news filter
snmail [-sP] [listname [prefix]]
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 References: 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.
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.
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.
snmail exits 0 if the message was successfully converted and written, or if the message ID already exists in the ID database and the message 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.
Harold Tay | N.B. |