SMTP(1)

πŸ“¦
version 7.9.0p0 Β· 2 versions
  • 7.9.0p0 Β· alpine 3.24, arch rolling, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 6.8.0p2 Β· debian bookworm, ubuntu jammy
, in alpine 3.24, arch rolling, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’Œ SMTP(1) β€” the smtp girlies' field guide πŸ’Œ

okay so bestie, gather round, because we're talking about smtp, aka the Simple Mail Transfer Protocol client from the General Commands Manual. she's giving mail girlie, she's giving handshake energy, and honestly? iconic. πŸŽ€


✨ NAME ✨

smtp β€” Simple Mail Transfer Protocol client πŸ’–


🌸 SYNOPSIS 🌸

smtp [-Chnv] [-a authfile] [-F from] [-H helo] [-s server] [-T params]
     [recipient ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the smtp utility is a Simple Mail Transfer Protocol (SMTP) client, and you literally use it to run an SMTP transaction against an SMTP server. that's the whole vibe. 🫢

by default, smtp reads the mail content from the standard input, establishes an SMTP session, and runs an SMTP transaction for all the specified recipients. the content is sent unaltered as mail data β€” no edits, no glow-up, it goes out exactly as it came in. periodt. πŸ’…

the options are as follows:


πŸ‘‘ OPTIONS πŸ‘‘

  • -a authfile β€” do a login before sending the message πŸ’Œ the username and password are read from authfile and need to be on the first and second line respectively. this option requires a TLS or STARTTLS server β€” no TLS, no login, sorry babe.
  • -C β€” do not require the server certificate to be valid. ⚠️ heads up though: this flag is deprecated. use -T noverify instead, bestie.
  • -F from β€” set the return-path (MAIL FROM) for the SMTP transaction. defaults to the current username. 🫑
  • -H helo β€” define the hostname to advertise (HELO) when establishing the SMTP session. she's introducing herself. πŸ’β€β™€οΈ
  • -h β€” display usage. the classic "help me bestie" flag.
  • -n β€” do not actually execute a transaction, just try to establish an SMTP session and quit. when this option is given, no message is read from the standard input. it's giving window shopping, not buying. πŸ›οΈ
  • -s server β€” specify the server to connect to and the connection parameters. the format is [proto://[user:pass@]]host[:port]. the following protocols are available:
    • smtp β€” normal SMTP session with opportunistic STARTTLS. 🌀️
    • smtp+tls β€” normal SMTP session with mandatory STARTTLS. no TLS, no entry. πŸ”’
    • smtp+notls β€” plain text SMTP session without TLS. πŸ™ˆ
    • lmtp β€” LMTP session with opportunistic STARTTLS. 🌀️
    • lmtp+tls β€” LMTP session with mandatory STARTTLS. πŸ”’
    • lmtp+notls β€” plain text LMTP session without TLS. πŸ™ˆ
    • smtps β€” SMTP session with forced TLS on connection. πŸ”₯

defaults to smtp://localhost:25. the default. the blueprint. ✨

  • -T params β€” set specific parameters for TLS sessions. the params string is a comma or space separated list of options. the available options are:
    • cafile=filename β€” use filename as the root certificates file instead of the system default. πŸ“
    • ciphers=value β€” specify the allowed ciphers. refer to tls_config_set_ciphers(3) for value. πŸ”
    • nosni β€” disable Server Name Indication (SNI). 🚫
    • noverify β€” do not require the server certificate to be valid. 😬 (the non-deprecated glow-up of -C)
    • protocols=value β€” specify the protocols to use. refer to tls_config_parse_protocols(3) for value. πŸ“œ
    • servername=value β€” use value for Server Name Indication (SNI). defaults to the specified server hostname. 🏷️
  • -v β€” be more verbose. this option can be specified multiple times, so stack her up like your skincare routine. the more -v, the more she tells you. πŸ—£οΈβœ¨

πŸŽ€ SEE ALSO πŸŽ€

  • smtpd(8) β€” the other half of the story, go read her too πŸ’œ

⭐ HISTORY ⭐

the smtp program first appeared in OpenBSD 6.4. a legend from day one, no cap. πŸ‘‘


ngl, if you're doing the -a authfile thing, remember: TLS or STARTTLS server required. required. don't skip it, bestie, i'm literally begging. 😭

and that's the whole page, we ate and left no crumbs. πŸ’… this gorgeous little write-up is living in the Debian release from May 23, 2021, filed under SMTP(1) β€” so when you cite her, cite her right. bye babes, go send some mail! πŸ¦‹πŸ’–πŸŒΈ

πŸ“¦ where this page comes from