smrsh(8) on Solnix vs Linux and the BSDs

smrsh is the illumos restricted shell for sendmail's prog mailer. It runs only programs found in /var/adm/sm.bin. FreeBSD smrsh uses /usr/libexec/sm.bin by default, so the allowed-commands directory differs.

What Solnix runs

A default Solnix system runs the illumos smrsh. The command is not in /usr/bin, /usr/sbin or /sbin, and the page does not give its install path. No other variants are shipped. The page is published by pkgs.solnix.illumos-world-man. The bundle has no Linux, OpenBSD or NetBSD counterpart page.

Differences

Compared withTopicWhat differs
FreeBSDallowed-command directorySolnix smrsh confines programs to /var/adm/sm.bin. FreeBSD smrsh uses /usr/libexec/sm.bin by default. Populate the directory that matches the system.
Source: Solnix smrsh(8) DESCRIPTION; FreeBSD smrsh(8) DESCRIPTION
FreeBSDshell builtinsFreeBSD smrsh also allows the shell builtins exec, exit and echo. The Solnix page mentions no builtins; it says only that programs must be in /var/adm/sm.bin.
Source: FreeBSD smrsh(8) DESCRIPTION; Solnix smrsh(8) DESCRIPTION
FreeBSDrejected charactersSolnix rejects , < > | ; & $ CR and LF. FreeBSD rejects ` < > ; $ ( ) CR and LF as listed. Solnix lists | and & as rejected, and FreeBSD allows || and && as operators. Solnix lists no parentheses.
Source: Solnix smrsh(8) DESCRIPTION (second paragraph); FreeBSD smrsh(8) DESCRIPTION (second paragraph)
FreeBSD|| and && chainingFreeBSD smrsh allows || and && so a prog mailer can run something like "|exec /usr/local/bin/filter || exit 75". The Solnix page rejects | and & and documents no such chaining.
Source: FreeBSD smrsh(8) DESCRIPTION; Solnix smrsh(8) DESCRIPTION
FreeBSDprocmail adviceThe Solnix page lists procmail as a reasonable addition to sm.bin. FreeBSD says including mail filtering programs such as procmail is a very bad idea, because procmailrc lets users run arbitrary programs.
Source: Solnix smrsh(8) DESCRIPTION (fourth paragraph); FreeBSD smrsh(8) DESCRIPTION (last paragraph)
FreeBSD-c optionBoth systems document the same invocation, smrsh -c command. The Solnix page has an OPTIONS section describing -c; the FreeBSD page has none.
Source: Solnix smrsh(8) SYNOPSIS, OPTIONS -c; FreeBSD smrsh(8) SYNOPSIS
FreeBSDconfigurable directoryFreeBSD says the directory is /usr/libexec/sm.bin 'by default', which implies it can be changed. The Solnix page names /var/adm/sm.bin and does not say it can be changed.
Source: FreeBSD smrsh(8) DESCRIPTION; Solnix smrsh(8) DESCRIPTION

Standards

  • POSIX: smrsh is not a POSIX.1-2024 utility.
  • Solnix: The Solnix page refers to attributes(7) in SEE ALSO. The trimmed text shows no interface stability table.

Writing portable scripts

  • Do not hard-code the sm.bin path in scripts or sendmail configuration: it is /var/adm/sm.bin on Solnix and /usr/libexec/sm.bin on FreeBSD.
  • Do not rely on shell operators such as || or && in |program entries. Solnix smrsh rejects | and &, while FreeBSD allows || and &&.

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.