snmail,v0.3.8(8)
π snmail β mail-to-news filter
okay bestie, welcome to the snmail,v0.3.8(8) page from the System Manager's Manual section 8 (that's the admin-y section, iykyk). This is the glow-up of the classic manual, same facts, way more fun. Let's get into it π
β¨ NAME β¨
snmail β mail-to-news filter π¦
πΈ SYNOPSIS πΈ
snmail [-sP] [listname [prefix]]
π DESCRIPTION π
So here's the vibe: snmail reads one single email message on standard input, and writes the converted message to standard output. That output? It's literally made to be fed straight into snstore. Chef's kiss. π
Here's everything snmail does to your message, no cap:
- If the first line is a UUCP
From_line, it gets silently discarded. gone. bye. π - A
Newsgroups:line is added with the value ofprefixlistname(that'sprefixconcatenated withlistname), and any otherNewsgroups:lines that already exist get removed. - A
Path:line is created from all theReceived:lines, and then thoseReceived:lines are removed. - All header lines are unfolded.
- If there's no message ID, one gets created.
- The message IDs sitting in all
References:lines andIn-Reply-To:lines are collected into a singleReferences:line. - All lines are rewritten to end in CRLF.
- And a lone
.on a line gets written at the end of the message.
Also, snmail will accept and pass on messages with invalid header fields. It's very forgiving like that. π«Ά
snmail is meant to be run from a .forward file, or from /etc/aliases (if you're running sendmail or something similar), or from a .qmail file (if qmail is your thing). And heads up β snmail may write status or error messages to standard error.
β¨ OPTIONS β¨
-sβ pipe output straight tosnstore, don't write to standard output. This exists so the exit status doesn't get lost in a shell pipeline (we love not losing exit statuses π). If you use this flag, it's also a really good idea to also use-c, which tellssnstoreto check if the article already exists.
π Other options π
snmail also accepts options meant for snstore, namely -c, -v, and -n, and these get passed on uninterpreted. Zero meddling. π
π ARGUMENTS π
- prefix β this is the prefix of the newsgroup. If you don't specify it, it defaults to
local.(note the trailing.). Also:prefixmay not begin with a.(dot), but it may be empty. - listname β this completes the newsgroup name. If you don't specify it, it's the local part of the address in the
Return-Path:line, as long as that exists and isn't empty. Otherwise? It's the local part of the message's firstFrom:. So like, if the message came from the list<linux-lemmings@vger.rutgers.edu>, then the default newsgroup becomeslocal.linux-lemmings. Andlistnamemay be empty ifprefixisn't.
bestie, you might wanna have a file /var/spool/sn/prefixlistname/.nopost so you can deny posting from all and sundry β that stops the mailing list newsgroup from getting contaminated. π§Ό
Also, prefix and listname may contain uppercase characters β those get converted to lowercase. no shouting in newsgroup names π
π USAGE π
There are two ways of forwarding mail to the sn news spool:
- Directly from a user's mail address. βοΈ
- Forwarded to a central address, and then invoking
snmail. π¬
The big concern here is permissions β because 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, its value is used in place of/var/spool/sn, the default news spool directory.PATHβ if-swas specified, this determines where to look forsnstore, 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 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
π N.B. π
and that's the whole page, bestie!! π«Ά this gem is by Harold Tay, and it's snmail,v0.3.8(8) β version 0.3.8, section 8 of the System Manager's Manual. no date on this one, iconic honestly. go forth and filter that mail-to-news, you absolute main character πβ¨
π¦ where this page comes from
- debian bookworm: sn 0.3.8-12
- ubuntu jammy: sn 0.3.8-12
- ubuntu noble: sn 0.3.8-12
- ubuntu resolute: sn 0.3.8-12
- ubuntu stonking: sn 0.3.8-12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms