Terminal Email

nmh vs S-nail

nmh: The MH message handling system: separate shell commands to read, file, search and send mail stored one file per message.
S-nail: Command-line mail program that implements POSIX mailx, with MIME, IMAP, POP3, SMTP, Maildir and S/MIME support.

Differences

Side by side

nmhS-nail
InterfaceCommand-line tools and promptsCommand-line tools and prompts
LanguageCC
LicenseBSD 3-ClauseISC and BSD 2-Clause and BSD 3-Clause and BSD 4-Clause
Latest version1.814.9.25
LinuxNativeNative
macOSNativeNative
WindowsThrough WSLThrough WSL
BSDNativeNative
AndroidThrough TermuxNo
IMAPThrough a separate toolYes
POP3YesYes
SMTPYesYes
JMAPNoNo
MaildirYesYes
mboxYesYes
notmuchNoNo
OpenPGPNoNo
S/MIMENoYes
OAuth2 sign-inNovia script
ThreadsNoYes
Searchpick command matches header fields and message textbuilt-in message specifications and the search command; IMAP SEARCH on IMAP folders
HTML mailvia mhshow with an external converter such as w3mbuilt-in tag-soup filter or external viewer via mailcap
MouseNoNo
Multiple accountsvia per-command switches or separate profilesYes
Offline usefull; messages are stored as local filesIMAP cache with disconnected mode
Calendarreplies to invitations with mhicalNo
Contactsaliases via MailAliases and the ali commandaliases via the alias command
Vim-style keysNoNo
Configuration~/.mh_profile and mts.conf text files~/.mailrc command file

Which to choose

Choose nmh for

  • Every action is a shell command, so mail handling is easy to script.
  • One file per message lets grep, find and other Unix tools work on mail.
  • Built-in POP3 and SMTP with TLS and SASL; reads mbox and Maildir drops.

Watch out for

  • No IMAP; IMAP mail must be synced to a Maildir first and then incorporated.
  • No built-in OpenPGP or S/MIME, and no thread view.
  • SMTP authentication needs nmh built with Cyrus SASL and its PLAIN or LOGIN plugin.

Install nmh

Choose S-nail for

  • Drop-in POSIX mailx, so it works in existing shell scripts and cron jobs.
  • Built-in SMTP, POP3 and IMAP with TLS; no separate sync or send tool needed.
  • S/MIME signing and encryption are built in.

Watch out for

  • Line-oriented prompt instead of a full-screen interface.
  • No built-in OpenPGP; upstream documents a gpg pipe workaround only.
  • IMAP support is kept at an older code level and upstream advises care.

Install S-nail

Questions

What is the difference between nmh and S-nail?

Only S-nail has built-in IMAP. On Android, nmh runs through Termux and S-nail is not available. nmh has calendar support; S-nail does not.

Which runs on Windows, nmh or S-nail?

On Windows, nmh runs through WSL. On Windows, S-nail runs through WSL.

See also: nmh alternatives, S-nail alternatives.