xref: /openbsd/usr.sbin/smtpd/smtp.1 (revision 3231622f)
1.\"	$OpenBSD: smtp.1,v 1.14 2021/05/23 16:12:56 eric Exp $
2.\"
3.\" Copyright (c) 2018, Eric Faurot <eric@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: May 23 2021 $
18.Dt SMTP 1
19.Os
20.Sh NAME
21.Nm smtp
22.Nd Simple Mail Transfer Protocol client
23.Sh SYNOPSIS
24.Nm
25.Op Fl Chnv
26.Op Fl a Ar authfile
27.Op Fl F Ar from
28.Op Fl H Ar helo
29.Op Fl s Ar server
30.Op Fl T Ar params
31.Op Ar recipient ...
32.Sh DESCRIPTION
33The
34.Nm
35utility is a Simple Mail Transfer Protocol
36.Pq SMTP
37client which can be used to run an SMTP transaction against an SMTP server.
38.Pp
39By default,
40.Nm
41reads the mail content from the standard input, establishes an SMTP session,
42and runs an SMTP transaction for all the specified recipients.
43The content is sent unaltered as mail data.
44.Pp
45The options are as follows:
46.Bl -tag -width Ds
47.It Fl a Ar authfile
48Perform a login before sending the message.
49The username and password are read from
50.Ar authfile
51and need to be on the first and second line respectively.
52This option requires a TLS or STARTTLS
53.Ar server .
54.It Fl C
55Do not require server certificate to be valid.
56This flag is deprecated.
57Use
58.Dq Fl T Cm noverify
59instead.
60.It Fl F Ar from
61Set the return-path (MAIL FROM) for the SMTP transaction.
62Default to the current username.
63.It Fl H Ar helo
64Define the hostname to advertise (HELO) when establishing the SMTP session.
65.It Fl h
66Display usage.
67.It Fl n
68Do not actually execute a transaction,
69just try to establish an SMTP session and quit.
70When this option is given, no message is read from the standard input.
71.It Fl s Ar server
72Specify the server to connect to and connection parameters.
73The format is
74.Sm off
75.Op Ar proto No :// Op Ar user : pass No @
76.Ar host Op : Ar port .
77.Sm on
78The following protocols are available:
79.Pp
80.Bl -tag -width "smtp+notls" -compact
81.It smtp
82Normal SMTP session with opportunistic STARTTLS.
83.It smtp+tls
84Normal SMTP session with mandatory STARTTLS.
85.It smtp+notls
86Plain text SMTP session without TLS.
87.It lmtp
88LMTP session with opportunistic STARTTLS.
89.It lmtp+tls
90LMTP session with mandatory STARTTLS.
91.It lmtp+notls
92Plain text LMTP session without TLS.
93.It smtps
94SMTP session with forced TLS on connection.
95.El
96.Pp
97Defaults to
98.Dq smtp://localhost:25 .
99.It Fl T Ar params
100Set specific parameters for TLS sessions.
101The
102.Ar params
103string is a comma or space separated list of options.
104The available options are:
105.Bl -tag -width Ds
106.It Cm cafile Ns = Ns Ar filename
107Use
108.Ar filename
109as root certificates file instead of the system default.
110.It Cm ciphers Ns = Ns Ar value
111Specify the allowed ciphers.
112Refer to
113.Xr tls_config_set_ciphers 3
114for
115.Ar value .
116.It Cm nosni
117Disable Server Name Indication (SNI).
118.It Cm noverify
119Do not require server certificate to be valid.
120.It Cm protocols Ns = Ns Ar value
121Specify the protocols to use.
122Refer to
123.Xr tls_config_parse_protocols 3
124for
125.Ar value .
126.It Cm servername Ns = Ns Ar value
127Use
128.Ar value
129for Server Name Indication (SNI).
130Defaults to the specified server hostname.
131.El
132.It Fl v
133Be more verbose.
134This option can be specified multiple times.
135.El
136.Sh SEE ALSO
137.Xr smtpd 8
138.Sh HISTORY
139The
140.Nm
141program first appeared in
142.Ox 6.4 .
143