xref: /dragonfly/libexec/dma/dma.8 (revision a765cedf)
1.\"
2.\" Copyright (c) 2008-2014, Simon Schubert <2@0x2c.org>.
3.\" Copyright (c) 2008
4.\"	The DragonFly Project.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\"
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in
14.\"    the documentation and/or other materials provided with the
15.\"    distribution.
16.\" 3. Neither the name of The DragonFly Project nor the names of its
17.\"    contributors may be used to endorse or promote products derived
18.\"    from this software without specific, prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.Dd January 17, 2023
34.Dt DMA 8
35.Os
36.Sh NAME
37.Nm dma
38.Nd DragonFly Mail Agent
39.Sh SYNOPSIS
40.Nm
41.Op Fl DiOt
42.Op Fl A Ns Ar mode
43.Op Fl b Ns Ar mode
44.Op Fl f Ar sender
45.Op Fl L Ar tag
46.Op Fl o Ns Ar option
47.Op Fl r Ar sender
48.Op Fl q Ns Op Ar arg
49.Op Ar recipient ...
50.Sh DESCRIPTION
51.Nm
52is a small Mail Transport Agent (MTA), designed for home and office use.
53It accepts mails from locally installed Mail User Agents (MUA) and
54delivers the mails either locally or to a remote destination.
55Remote delivery includes several features like TLS/SSL support and SMTP
56authentication.
57.Pp
58.Nm
59is not intended as a replacement for real, big MTAs like
60.Xr sendmail 8
61or
62.Xr postfix 1 .
63Consequently,
64.Nm
65does not listen on port 25 for incoming connections.
66.Pp
67The options are as follows:
68.Bl -tag -width indent
69.It Fl A Ns Ar mode
70.Fl \&Ac
71acts as a compatibility option for sendmail.
72.It Fl b Ns Ar mode
73.Bl -tag -width indent
74.It Fl bp
75List all mails currently stored in the mail queue.
76.It Fl bq
77Queue the mail, but don't attempt to deliver it.
78See also the
79.Sq DEFER
80config file setting below.
81.El
82.Pp
83All other
84.Ar mode Ns
85s are ignored.
86.It Fl D
87Don't run in the background.
88Useful for debugging.
89.It Fl f Ar sender
90Set sender address (envelope-from) to
91.Ar sender .
92This overrides the value of the
93.Ev EMAIL
94environment variable, but is overridden by the
95.Sq MASQUERADE
96config file setting.
97.It Fl i
98Ignore dots alone on lines by themselves in incoming messages.
99This should be set if you are reading data from a file.
100.It Fl L Ar tag
101Set the identifier used in syslog messages to the supplied
102.Ar tag .
103This is a compatibility option for sendmail.
104.It Fl O
105This is a compatibility option for sendmail.
106.It Fl o Ns Ar option
107Specifying
108.Fl oi
109is synonymous to
110.Fl i .
111All other options are ignored.
112.It Fl q Ns Op Ar arg
113Process saved messages in the queue.
114The argument is optional and ignored.
115.It Fl r Ar sender
116Same as
117.Fl f .
118.It Fl t
119Obtain recipient addresses from the message header.
120.Nm
121will parse the
122.Li To: ,
123.Li Cc: ,
124and
125.Li Bcc:
126headers.
127The
128.Li Bcc:
129header will be removed independent of whether
130.Fl t
131is specified or not.
132.El
133.Sh CONFIGURATION
134.Nm
135can be configured with two config files:
136.Pp
137.Bl -bullet -compact
138.It
139auth.conf
140.It
141dma.conf
142.El
143.Pp
144These two files are stored per default in
145.Pa /etc/dma .
146.Sh FILE FORMAT
147Every file contains parameters of the form
148.Sq name value .
149Lines containing boolean values are set to
150.Sq NO
151if the line is commented and to
152.Sq YES
153if the line is uncommented.
154Empty lines or lines beginning with a
155.Sq #
156are ignored.
157Parameter names and their values are case sensitive.
158.Sh PARAMETERS
159.Ss auth.conf
160SMTP authentication can be configured in
161.Pa auth.conf .
162Each line has the format
163.Dq Li user|smarthost:password .
164.Pp
165.Nm
166uses the recipient MTA hostname and finds the first entry in the auth.conf
167file that matches the smarthost value or the hostname of the recipient
168address.
169It then uses the user and password to authenticate with the smarthost.
170.Pp
171Note, that the only authentication method supported is CRAM-MD5.
172The receiving MTA must be configured to accept CRAM-MD5 authentication.
173.Ss dma.conf
174Most of the behaviour of
175.Nm
176can be configured in
177.Pa dma.conf .
178.Bl -tag -width 4n
179.It Ic SMARTHOST Xo
180(string, default=empty)
181.Xc
182If you want to send outgoing mails via a smarthost, set this variable to
183your smarthosts address.
184.It Ic PORT Xo
185(numeric, default=25)
186.Xc
187Use this port to deliver remote emails.
188Only useful together with the
189.Sq SMARTHOST
190option, because
191.Nm
192will deliver all mails to this port, regardless of whether a smarthost is set
193or not.
194.It Ic ALIASES Xo
195(string, default=/etc/aliases)
196.Xc
197Path to the local aliases file.
198Just stick with the default.
199The aliases file is of the format
200.Dl nam: dest1 dest2 ...
201In this case, mails to
202.Li nam
203will instead be delivered to
204.Li dest1
205and
206.Li dest2 ,
207which in turn could be entries in
208.Pa /etc/aliases .
209The special name
210.Ql *
211can be used to create a catch-all alias, which gets used if no other
212matching alias is found.
213Use the catch-all alias only if you don't want any local mail to be
214delivered.
215.It Ic SPOOLDIR Xo
216(string, default=/var/spool/dma)
217.Xc
218Path to
219.Nm Ap s
220spool directory.
221Just stick with the default.
222.It Ic AUTHPATH Xo
223(string, default=not set)
224.Xc
225Path to the
226.Sq auth.conf
227file.
228.It Ic SECURETRANSFER Xo
229(boolean, default=commented)
230.Xc
231Uncomment if you want TLS/SSL secured transfer.
232.It Ic STARTTLS Xo
233(boolean, default=commented)
234.Xc
235Uncomment if you want to use STARTTLS.
236Only useful together with
237.Sq SECURETRANSFER .
238.It Ic FINGERPRINT Xo
239(string, default=empty)
240.Xc
241Pin the server certificate by specifying its SHA256 fingerprint.
242Only makes sense if you use a smarthost.
243.It Ic OPPORTUNISTIC_TLS Xo
244(boolean, default=commented)
245.Xc
246Uncomment if you want to allow the STARTTLS negotiation to fail.
247Most useful when
248.Nm
249is used without a smarthost, delivering remote messages directly to
250the outside mail exchangers; in opportunistic TLS mode, the connection will
251be encrypted if the remote server supports STARTTLS, but an unencrypted
252delivery will still be made if the negotiation fails.
253Only useful together with
254.Sq SECURETRANSFER
255and
256.Sq STARTTLS .
257.It Ic CERTFILE Xo
258(string, default=empty)
259.Xc
260Path to your SSL certificate file.
261.It Ic SECURE Xo
262(boolean, default=commented)
263.Xc
264Uncomment this entry and change it to
265.Sq INSECURE
266to use plain text SMTP login over an insecure connection.
267You have to rename this variable manually to prevent that you send your
268password accidentally over an insecure connection.
269.It Ic DEFER Xo
270(boolean, default=commented)
271.Xc
272Uncomment if you want that
273.Nm
274defers your mail.
275You have to flush your mail queue manually with the
276.Fl q
277option.
278This option is handy if you are behind a dialup line.
279.It Ic FULLBOUNCE Xo
280(boolean, default=commented)
281.Xc
282Uncomment if you want the bounce message to include the complete original
283message, not just the headers.
284.It Ic MAILNAME Xo
285(string, default=empty)
286.Xc
287The internet hostname
288.Nm
289uses to identify the host.
290If not set or empty, the result of
291.Xr gethostname 3
292is used.
293If
294.Sq MAILNAME
295is an absolute path to a file, the first line of this file will be used
296as the hostname.
297.It Ic MASQUERADE Xo
298(string, default=empty)
299.Xc
300Masquerade the envelope-from addresses with this address/hostname.
301Use this setting if mails are not accepted by destination mail servers
302because your sender domain is invalid.
303This setting overrides the
304.Fl f
305flag and the
306.Ev EMAIL
307environment variable.
308.Pp
309If
310.Sq MASQUERADE
311does not contain a
312.Li @
313sign, the string is interpreted as a host name.
314For example, setting
315.Sq MASQUERADE
316to
317.Ql john@
318on host
319.Ql hamlet
320will send all mails as
321.Ql john@hamlet ;
322setting it to
323.Ql percolator
324will send all mails as
325.So
326.Sm off
327.Va username @percolator
328.Sm on
329.Sc .
330.It Ic NULLCLIENT Xo
331(boolean, default=commented)
332.Xc
333Bypass aliases and local delivery, and instead forward all mails to
334the defined
335.Sq SMARTHOST .
336.Sq NULLCLIENT
337requires
338.Sq SMARTHOST
339to be set.
340.El
341.Ss Environment variables
342The behavior of
343.Nm
344can be influenced by some environment variables.
345.Bl -tag -width 4n
346.It Ev EMAIL Xo
347.Xc
348Used to set the sender address (envelope-from).
349Use a plain address, in the form of
350.Li user@example.com .
351This value will be overridden when the
352.Sq MASQUERADE
353config file setting or the
354.Fl f
355flag is used.
356.El
357.Sh SEE ALSO
358.Xr forward 5 ,
359.Xr mailwrapper 8 ,
360.Xr sendmail 8
361.Rs
362.%A "J. B. Postel"
363.%T "Simple Mail Transfer Protocol"
364.%O RFC 821
365.Re
366.Rs
367.%A "J. Myers"
368.%T "SMTP Service Extension for Authentication"
369.%O RFC 2554
370.Re
371.Rs
372.%A "P. Hoffman"
373.%T "SMTP Service Extension for Secure SMTP over TLS"
374.%O RFC 2487
375.Re
376.Sh HISTORY
377The
378.Nm
379utility first appeared in
380.Dx 1.11 .
381.Sh AUTHORS
382.An -nosplit
383.Nm
384was written by
385.An Matthias Schmidt Aq Mt matthias@dragonflybsd.org
386and
387.An Simon Schubert Aq Mt 2@0x2c.org .
388.Sh CAVEATS
389.Nm
390does not currently support the
391.Xr forward 5
392feature.
393