mailx(1) on Solnix vs Linux and the BSDs

On Solnix, mailx is the illumos mailx at /usr/bin/mailx. It is a POSIX.1-2024 utility. Several single-letter flags differ from FreeBSD and NetBSD: -I, -r and -H mean different things, and Solnix lacks -E and -a. The Solnix system startup file also sets non-standard defaults unless you pass -n. The bundle has no Linux page.

What Solnix runs

A default Solnix system runs the illumos mailx at /usr/bin/mailx. The SYNOPSIS also lists /usr/ucb/mail and /usr/ucb/Mail, but the header says no other variants are shipped and the bundle does not describe them. When invoked as mail or Mail, it reads /etc/mail/Mail.rc instead of /etc/mail/mailx.rc.

Differences

Compared withTopicWhat differs
FreeBSD, NetBSDsystem startup file sets non-standard defaultsMany Solnix administrators put set appenddeadletter, unset replyall and unset pipeignore in the system startup file for old Solaris compatibility. The page says this does not meet standards requirements. Use -n or a personal startup file for standard behaviour. The BSD excerpts describe no such split.
Source: Solnix mailx(1) USAGE, Starting Mail; -n
NetBSD-I meaningSolnix -I includes newsgroup and article-id header lines when printing, and requires -f. NetBSD -I forces interactive mode even when input is not a terminal. On Solnix the equivalent for tilde escapes is -~.
Source: Solnix mailx(1) -I, -~; NetBSD mailx(1) -I
NetBSD-r meaningSolnix -r address sets the return address passed to the delivery program and disables all tilde commands. NetBSD -r names an alternate rcfile that overrides MAILRC and ~/.mailrc.
Source: Solnix mailx(1) -r; NetBSD mailx(1) -r
NetBSD-n and the startup file locationSolnix -n skips the system file /etc/mail/mailx.rc (or Mail.rc); $HOME/.mailrc is then still the personal file. NetBSD -n skips /etc/mail.rc. The Solnix excerpt does not mention a MAILRC variable.
Source: Solnix mailx(1) -n, USAGE Starting Mail; NetBSD mailx(1) -n, -r
FreeBSD, NetBSD-E missingThe FreeBSD and NetBSD synopses have -E. NetBSD documents it as not sending messages with an empty body, useful for cron error pipes. Solnix has no -E. Solnix -e is a different flag: it tests whether mail exists.
Source: NetBSD mailx(1) -E; FreeBSD mailx(1) SYNOPSIS; Solnix mailx(1) -e, SYNOPSIS
NetBSDattachmentsNetBSD mail -a attaches a file to the message. Solnix mailx has no -a in its synopsis or options.
Source: NetBSD mailx(1) -a; Solnix mailx(1) SYNOPSIS, OPTIONS
NetBSD-H behaviourSolnix -H prints the header summary only. NetBSD -H takes an optional colon-modifier, such as -H:n for new messages, and exits. The FreeBSD -H text is not in the bundle.
Source: Solnix mailx(1) -H; NetBSD mailx(1) -H; FreeBSD mailx(1) SYNOPSIS
NetBSD-u userSolnix -u reads the named user's mailbox, but only if it is not read protected. NetBSD -u is documented as equivalent to mail -f /var/mail/user.
Source: Solnix mailx(1) -u; NetBSD mailx(1) -u
FreeBSD, NetBSDSolnix-only optionsOnly Solnix documents -t (take recipients from To:, Cc: and Bcc: in the input), -h number (hop count), -T file, -U (convert UUCP addresses), -B (unbuffered I/O) and -V (print version).
Source: Solnix mailx(1) -t, -h, -T, -U, -B, -V; FreeBSD and NetBSD mailx(1) SYNOPSIS
FreeBSD, NetBSDpassing options to sendmailFreeBSD and NetBSD synopses accept sendmail options after the recipients. NetBSD says they are passed directly to sendmail. The Solnix synopsis has no such trailing options. It passes only -v to sendmail(8), and -r and -h to the delivery program.
Source: FreeBSD mailx(1) SYNOPSIS; NetBSD mailx(1) Sending mail; Solnix mailx(1) -v, -r, -h
FreeBSDenvironment variablesThe FreeBSD page documents DEAD (default ~/dead.letter), MAIL (default /var/mail), MAILRC (default ~/.mailrc), LISTER, PAGER, REPLYTO and others. The Solnix excerpt in the bundle shows only MBOX, the mbox file in HOME, so compare its full ENVIRONMENT VARIABLES section before relying on these.
Source: FreeBSD mailx(1) ENVIRONMENT; Solnix mailx(1) DESCRIPTION (MBOX)
FreeBSD, NetBSDcommand namesFreeBSD documents mail, Mail and mailx, and notes that mail is usually a link to Mail and mailx. NetBSD documents mail and mailx. Solnix lists /usr/ucb/mail and /usr/ucb/Mail as alternate names, and mail or Mail selects /etc/mail/Mail.rc.
Source: FreeBSD mailx(1) NAME, BUGS; NetBSD mailx(1) NAME; Solnix mailx(1) SYNOPSIS, USAGE

Standards

  • POSIX: mailx is a POSIX.1-2024 utility.
  • Solnix: The USAGE section says the Solaris-compatible system startup defaults (appenddeadletter, no replyall, no pipeignore) do not meet standards requirements for mailx. Use -n for standard behaviour.

Writing portable scripts

  • Always run mailx -n in scripts on Solnix, so the system startup file cannot change replyall, pipeignore or appenddeadletter behaviour.
  • Avoid -I, -r, -H, -E and -a in portable scripts. They mean different things, or are missing, between Solnix, FreeBSD and NetBSD. Use only -s, -c, -b and plain recipients.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.