SSMTP(8)

πŸ’– SSMTP(8) πŸ’– β€” the send-only sendmail emulator, explained by your bestie

okay so this whole page comes from the System Manager's Manual (section 8, the sysadmin one, iykyk) and it covers two names living one life: ssmtp and sendmail. same energy, one manual. let's get into it. 🫢


πŸŽ€ NAME πŸŽ€

ssmtp, sendmail β€” send a message using smtp. that's the whole job, and honestly? it eats. πŸ’…


🌸 SYNOPSIS 🌸

ssmtp [ flags ] [ address ... ]
/usr/lib/sendmail [ flags ] [ address ... ]

✨ DESCRIPTION ✨

okay so ssmtp is a send-only sendmail emulator β€” it sends, it never receives, and it's built for machines that normally go pick their mail up from a centralized mailhub (via pop, imap, nfs mounts, or whatever other means you've got going on). it gives you exactly the functionality that humans and programs need in order to send mail through the standard user agents or through /usr/bin/mail. chef's kiss. 😌

how it actually works: it takes a mail stream on standard input, you pass the recipients on the command line, and it synchronously forwards the message to the mail transfer agent of a mailhub, which then processes it. and if a message fails? it lands in dead.letter in the sender's home directory. πŸ’€ tuck that knowledge in your pocket.

the config files let you set: the address that receives mail from root, daemon, etc.; a default mailhub; a default domain to be used in From: lines; and per-user From: addresses and mailhub names. so much control, so little drama.

now for the real talk, bestie: it does not attempt to provide all the functionality of sendmail. it's intended for use where other programs are the primary means of mail delivery. it's useful with pop/imap, or to simulate the Sun shared mail spool option for non-Sun machines, for machines whose sendmails are too difficult (or too various) to configure, for machines with known disfeatures in their sendmails, or for ones where there are ``mysterious problems''. πŸ™ˆ we've all met that machine.

it does not do aliasing β€” that has to happen either in the user agent or on the mailhub. it also does not honor .forwards, because those have to be done on the receiving host. and it especially does not deliver to pipelines. not now, not ever. periodt. πŸ’…


πŸ’… OPTIONS πŸ’…

most sendmail options are just... irrelevant to sSMTP, bestie. here's the decoder ring:

  • marked ignored'' or default'' β†’ no effect on mail transfer
  • marked ``unsupported'' β†’ fatal errors 😭
  • marked ``simulated'' β†’ not errors, but the result is that the program exits with an informative message. a sort of fatal non-error. make it make sense, but that's canon.
  • -4 β€” forces ssmtp to use IPv4 addresses only.
  • -6 β€” forces ssmtp to use IPv6 addresses only.
  • -B body_type β€” (ignored) the message body MIME type: 7BIT or 8BITMIME.
  • -auusername β€” specifies the username for SMTP authentication.
  • -appassword β€” specifies the password for SMTP authentication.
  • -ammechanism β€” specifies the mechanism for SMTP authentication. only LOGIN and CRAM-MD5, bestie, don't get creative.
  • -ba β€” (unsupported) ARPANET mode. all input lines must end with a LINEFEED, and all messages will be generated with a CR-LF at the end. also, the From:'' and Sender:'' fields are examined for the name of the sender.
  • -bd β€” (unsupported) run as a daemon.
  • -bi β€” (ignored) initialise the alias database.
  • -bm β€” (default) deliver mail in the usual way.
  • -bp β€” (simulated) print a summary of the mail queue.
  • -bs β€” (unsupported) read SMTP commands from stdin.
  • -bt β€” (unsupported) run in address test mode.
  • -bv β€” (unsupported) verify names only.
  • -bz β€” (unsupported) create the configuration freeze file.
  • -Cfile β€” use alternate configuration file.
  • -dX β€” set debugging value to X.
  • -E β€” (ignored) don't trust the userid of the sender.
  • -Ffullname β€” set the full name of the sender.
  • -fname β€” sets the name of the ``from'' person. this option is valid only if no From: line is specified within the header of the email.
  • -hN β€” (ignored) set the hop count to N.
  • -m β€” (ignored) ignore originator in alias.
  • -Mid β€” (ignored) attempt to deliver the queued message with message-id id.
  • -N dsn β€” (ignored) set delivery status notification conditions to dsn.
  • -n β€” (default) do not do aliasing.
  • -oAfile β€” (ignored) use alternate alias file.
  • -oc β€” (ignored) delay ``expensive'' connections.
  • -odx β€” (ignored) set the delivery mode to interactive/synchronous, background or queue (always interactive).
  • -oD β€” (ignored) run newaliases if required.
  • -oex β€” (ignored) set error processing to mail, write, print or quit (always print).
  • -oFmode β€” (ignored) the mode to use when creating temporary files.
  • -of β€” (ignored) save UNIX-system-style ``From'' lines at the front of messages.
  • -ogN β€” (ignored) set group ID to use when calling mailers.
  • -oHfile β€” (ignored) set SMTP help file.
  • -oi β€” (default) do not take dots on a line by themselves as a message terminator.
  • -oLn β€” (ignored) the log level.
  • -om β€” (default) send to ``me'' (the sender) also if in an alias.
  • -oo β€” (unsupported) if set, this message may have old style headers.
  • -oQqueuedir β€” (ignored) select the directory in which to queue messages.
  • -ortimeout β€” (ignored) the timeout on reads.
  • -oSfile β€” (ignored) save statistics in the named file.
  • -os β€” (ignored) always instantiate the queue.
  • -oTtime β€” (ignored) set timeout on messages.
  • -otstz,dtz β€” (ignored) set the name of the time zone.
  • -ouN β€” (ignored) set the default user id for mailers.
  • -q[time] β€” (simulated) process the queue.
  • -rname β€” same as -f.
  • -Rstring β€” (ignored) process queue for recipient.
  • -R return β€” (ignored) set the amount of the message to be returned if the message bounces.
  • -t β€” read message, searching for recipients. To:'', `Cc:'', and Bcc:'' lines will be scanned for people to send to. any addresses in the argument list will be suppressed (not supported).
  • -v β€” go into verbose mode.
  • -V β€” say version and quit.

πŸ¦‹ REVERSE ALIASES πŸ¦‹

a reverse alias gives you the From: address that gets placed on a user's outgoing messages, and (optionally) the mailhub those messages will be sent through. example:

root:jdoe@isp.com:mail.isp.com

so, messages that root sends will be identified as from jdoe@isp.com and sent through mail.isp.com. clean, simple, iconic. ✨


πŸ“ FILES πŸ“

  • /etc/ssmtp/ssmtp.conf β€” configuration file
  • /etc/ssmtp/revaliases β€” reverse aliases file

πŸ‘€ SEE ALSO πŸ‘€

RFC821, RFC822, ssmtp.conf(5). go read those too, bestie, for the full lore. πŸ“š


πŸ‘‘ AUTHORS πŸ‘‘

  • Matt Ryan (mryan@debian.org)
  • Hugo Haas (hugo@debian.org)
  • Christoph Lameter (clameter@debian.org)
  • Dave Collier-Brown (davecb@hobbes.ss.org)

absolute legends, every single one. 🫢


πŸ’€ BUGS πŸ’€

  • sSMTP does not support exception lists to the -t option (never seen it used).
  • sSMTP will fail if the mailhub is unreachable. 😭 yes, really, that's the whole bug.

ngl, this page was last changed on 4 February 2005, and it ships as part of the System Manager's Manual for SSMTP(8). vintage, but make it fashion. πŸŽ€
πŸ“¦ where this page comes from