POST(8mh)
π NAME π
post β deliver an nmh message.
(okay so this is POST(8mh), section 8 of the mh manual, and yes bestie we are reading the mail-delivery lore today, buckle up π)
β¨ SYNOPSIS β¨
/usr/lib/mh/post [-help] [-version] [-alias aliasfile] [-filter
filterfile] [-nofilter] [-format | -noformat] [-mime | -nomime]
[-msgid | -nomsgid] [-messageid localname | random] [-verbose |
-noverbose] [-watch | -nowatch] [-width columns] [-mts smtp |
sendmail/smtp | sendmail/pipe] [-sendmail program] [-server
servername] [-port portname/number] [-sasl] [-nosasl] [-saslmech
mechanism] [-user username] [-tls] [-initialtls] [-notls] [-snoop]
file
πΈ DESCRIPTION πΈ
post is the default program that send calls to actually deliver the message sitting in file to local and remote users. And like, plot twist: most of the features that everyone credits to send in its manual page? post is the one doing them. send is basically just the cute preprocessor standing in front of the curtain π«Ά. So yeah β it's post that parses all those header fields, appends the Date: line, and talks to the mail transport system.
post will not normally be called directly by you, bestie, but you can swap it out with a postproc profile component β in that case file is its final argument. Peep mh-profile(5) for the deets on postproc π
.
post goes hunting through the To:, cc:, Bcc:, Fcc:, and Resent-xxx: header lines of the message you handed it, looking for destination addresses. It checks that they're valid and formats them so they play nice with the ARPAnet Internet Message Format protocol β unless you set -noformat. Normally that means @local-site gets tacked onto every local destination address, plus any local return addresses. And the -width columns switch lets you say how long you want the address-y header components to be π.
If there's a Bcc: field in there, its addresses get used for delivery, and the Bcc: field gets yeeted out of the message that goes to the sighted recipients π. The blind recipients get a whole brand-new message with a minimal set of headers. The body of that new message contains a copy of the message that went to the sighted folks, and it's either marked up with the indicator text "Blind-Carbon-Copy" or encapsulated as a MIME digest.
If you pass -filter filterfile, then that copy gets filtered (re-formatted) by mhl before it's sent off to the blind recipients. Or, alternatively, if you give the -mime switch, post will use the MIME rules for encapsulation instead β¨.
Now. If a Dcc: field shows up and the sendmail/pipe mail transport method is not in use, its addresses get used for delivery and the Dcc: field gets removed from the message. The blind recipients get exactly the same message as the sighted recipients. π¬
WARNING β Recipients listed in theDcc:field receive no explicit indication that they have received a "blind copy". This can cause blind recipients to accidentally reply to all the sighted recipients of the original message, which reveals that they got a blind copy. On the other hand: since a normal reply to a message sent via aBcc:field generates a reply only to the sender of the original message, it takes extra effort in most mailers to reply to the included message β so it'd usually only happen on purpose, not by accident. Balance π
Also: post rejects any message that contains a Dcc: field if the sendmail/pipe mail transport method is used. Straight up no β.
The -alias aliasfile switch lets you point post at a file it should read aliases from. You can name more than one file β just put -alias before each one. Either way, the primary alias file is read first π.
The -msgid switch means a Message-ID: or Resent-Message-ID: field should be added to the header.
The -messageid switch picks the style for the part that comes after the @ in the Message-ID:, Resent-Message-ID:, and Content-ID: header fields. Two acceptable options: localname (that's the default, bestie) and random. With localname, the local hostname is used. With random, a random sequence of characters is used instead. Heads up: the -msgid switch must be enabled for this switch to have any effect at all π.
The -verbose switch means you, the user, get told about every single step of the posting/filing process π’.
The -watch switch means you'd like to watch the transport system's handling of the message (like, local and "fast" delivery) π.
π¦ the whole From: / Sender: / Envelope-From: situation π¦
Under normal circumstances, post uses the From: line in the message draft as the identity of the originating mailbox. A From: line is required in all message drafts. By default, the message composition utilities like comp, repl and mhmail will automatically drop a From: line into your draft. But there are two ways to override that behaviour. And btw, they apply equally to Resent-From: lines in messages sent with dist π
.
Way number one: supply a Sender: line. That field's value gets used as the originating mailbox identity when submitting the message to the mail transport system. And if multiple addresses are given in the From: line, a Sender: line is required. Also, if an Envelope-From: line is supplied when multiple addresses are given in the From: line, a Sender: header will be generated using the value of the Envelope-From: line β as long as that Envelope-From: line is not blank.
Way number two: supply an Envelope-From: line. Its value gets used as the originating mailbox identity when submitting the message to the mail transport system. This overrides both the value of the From: line and a Sender: line (if one was supplied). The Envelope-From: line is allowed to be blank β and if it is blank, the mail transport system gets instructed to not send any bounces in response to the message. Not all mail transport systems support this feature, so like, ymmv π.
π§ transport system tea π§
The mail transport system default is defined in /etc/nmh/mts.conf, but you can override it right here with the -mts switch.
If nmh is using sendmail/pipe or sendmail/smtp as its mail transport system, the -sendmail switch can be used to override the default sendmail program.
If nmh is using the SMTP MTA, the -server and -port switches can override the default mail server and port. The default server is set with servers in /etc/nmh/mts.conf, and the default port is submission, 587.
π SASL era π
If nmh has been compiled with SASL support, the -sasl and -nosasl switches will enable and disable the use of SASL authentication with the SMTP MTA. Depending on the SASL mechanism used, this may require an additional password prompt from the user (but the netrc file can be used to store this password, as described in mh-profile(5)). The -saslmech switch can be used to select a particular SASL mechanism, and the -user switch can be used to select an authorization userid to provide to SASL, other than the default. The credentials profile entry in mh-profile(5) describes the ways to supply a username and password π.
If SASL authentication is successful, nmh will attempt to negotiate a security layer for session encryption. Encrypted data is labelled with (sasl-encrypted) and (sasl-decrypted) when you're viewing the SMTP transaction with the -snoop switch. Base64-encoded data is wrapped with b64<>.
Beware bestie: the SMTP transaction may contain authentication information either in plaintext or easily decoded base64. π«£
π TLS era π
If nmh has been compiled with TLS support, the -tls and -initialtls switches will require the negotiation of TLS when connecting to the SMTP MTA. The -tls switch will negotiate TLS as part of the normal SMTP protocol using the STARTTLS command. The -initialtls will negotiate TLS immediately after the connection has taken place β before any SMTP commands are sent or received. Encrypted data is labelled with (tls-encrypted) and (tls-decrypted) when viewing the SMTP transaction with the -snoop switch. Base64-encoded data is wrapped with b64<>.
Same warning as above, fr fr: the SMTP transaction may contain authentication information either in plaintext or easily decoded base64. π
The -notls switch will disable all attempts to negotiate TLS.
If port 465 is specified and none of the TLS switches were enabled, -initialtls will be implied β if TLS support was compiled in. And yeah, though port 465 for SMTPS (SMTP over SSL) was deregistered by IANA in 1998, it is still used for that service. Vintage β¨.
One last thing: post filters out header lines with names beginning with Nmh- (case insensitive) from the message draft. Those lines are reserved for internal nmh use, so hands off π
.
π FILES π
/etc/nmh/mts.confβ nmh mts configuration file/etc/nmh/MailAliasesβ global nmh alias file/usr/bin/mh/refileβ Program to processFcc:s/usr/lib/mh/mhlβ Program to processBcc:s
π«Ά PROFILE COMPONENTS π«Ά
post does not consult the user's .mh_profile. Not even a little. It's simply not interested π.
π SEE ALSO π
mhmail(1), send(1), mh-mail(5), mh-alias(5), mh-profile(5), mh-tailor(5)
Standard for the Format of ARPA Internet Text Messages (RFC 822)
β DEFAULTS β
-aliasdefaults to/etc/nmh/MailAliases-format-nomime-nomsgid-messageid localname-noverbose-nowatch-width 72-nofilter
π CONTEXT π
None. Nothing. Empty. The void. π
π BUGS π
Reply-To: fields are allowed to have groups in them according to the RFC 822 specification, but post won't let you use them. So close, yet so far π₯².
and that's the whole page, bestie!! this was nmh-1.8, dated 2016-10-17, and it ate, no cap π β¨π¦
π¦ where this page comes from
- debian trixie: nmh 1.8-3
- ubuntu noble: nmh 1.8-1build4
- ubuntu questing: nmh 1.8-3
- ubuntu resolute: nmh 1.8-4
- ubuntu stonking: nmh 1.8-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms