xref: /freebsd/contrib/dma/dma.8 (revision 43a5ec4eb41567cc92586503212743d89686d78f)
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 May 20, 2017
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 do not 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
87Do not 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.Ss dma.conf
165Most of the behaviour of
166.Nm
167can be configured in
168.Pa dma.conf .
169.Bl -tag -width 4n
170.It Ic SMARTHOST Xo
171(string, default=empty)
172.Xc
173If you want to send outgoing mails via a smarthost, set this variable to
174your smarthosts address.
175.It Ic PORT Xo
176(numeric, default=25)
177.Xc
178Use this port to deliver remote emails.
179Only useful together with the
180.Sq SMARTHOST
181option, because
182.Nm
183will deliver all mails to this port, regardless of whether a smarthost is set
184or not.
185.It Ic ALIASES Xo
186(string, default=/etc/aliases)
187.Xc
188Path to the local aliases file.
189Just stick with the default.
190The aliases file is of the format
191.Dl nam: dest1 dest2 ...
192In this case, mails to
193.Li nam
194will instead be delivered to
195.Li dest1
196and
197.Li dest2 ,
198which in turn could be entries in
199.Pa /etc/aliases .
200The special name
201.Ql *
202can be used to create a catch-all alias, which gets used if no other
203matching alias is found.
204Use the catch-all alias only if you do not want any local mail to be
205delivered.
206.It Ic SPOOLDIR Xo
207(string, default=/var/spool/dma)
208.Xc
209Path to
210.Nm Ap s
211spool directory.
212Just stick with the default.
213.It Ic AUTHPATH Xo
214(string, default=not set)
215.Xc
216Path to the
217.Sq auth.conf
218file.
219.It Ic SECURETRANSFER Xo
220(boolean, default=commented)
221.Xc
222Uncomment if you want TLS/SSL secured transfer.
223.It Ic STARTTLS Xo
224(boolean, default=commented)
225.Xc
226Uncomment if you want to use STARTTLS.
227Only useful together with
228.Sq SECURETRANSFER .
229.It Ic FINGERPRINT Xo
230(string, default=empty)
231.Xc
232Pin the server certificate by specifying its SHA256 fingerprint.
233Only makes sense if you use a smarthost.
234.It Ic OPPORTUNISTIC_TLS Xo
235(boolean, default=commented)
236.Xc
237Uncomment if you want to allow the STARTTLS negotiation to fail.
238Most useful when
239.Nm
240is used without a smarthost, delivering remote messages directly to
241the outside mail exchangers; in opportunistic TLS mode, the connection will
242be encrypted if the remote server supports STARTTLS, but an unencrypted
243delivery will still be made if the negotiation fails.
244Only useful together with
245.Sq SECURETRANSFER
246and
247.Sq STARTTLS .
248.It Ic CERTFILE Xo
249(string, default=empty)
250.Xc
251Path to your SSL certificate file.
252.It Ic SECURE Xo
253(boolean, default=commented)
254.Xc
255Uncomment this entry and change it to
256.Sq INSECURE
257to use plain text SMTP login over an insecure connection.
258You have to rename this variable manually to prevent that you send your
259password accidentally over an insecure connection.
260.It Ic DEFER Xo
261(boolean, default=commented)
262.Xc
263Uncomment if you want that
264.Nm
265defers your mail.
266You have to flush your mail queue manually with the
267.Fl q
268option.
269This option is handy if you are behind a dialup line.
270.It Ic FULLBOUNCE Xo
271(boolean, default=commented)
272.Xc
273Uncomment if you want the bounce message to include the complete original
274message, not just the headers.
275.It Ic MAILNAME Xo
276(string, default=empty)
277.Xc
278The internet hostname
279.Nm
280uses to identify the host.
281If not set or empty, the result of
282.Xr gethostname 3
283is used.
284If
285.Sq MAILNAME
286is an absolute path to a file, the first line of this file will be used
287as the hostname.
288.It Ic MASQUERADE Xo
289(string, default=empty)
290.Xc
291Masquerade the envelope-from addresses with this address/hostname.
292Use this setting if mails are not accepted by destination mail servers
293because your sender domain is invalid.
294This setting overrides the
295.Fl f
296flag and the
297.Ev EMAIL
298environment variable.
299.Pp
300If
301.Sq MASQUERADE
302does not contain a
303.Li @
304sign, the string is interpreted as a host name.
305For example, setting
306.Sq MASQUERADE
307to
308.Ql john@
309on host
310.Ql hamlet
311will send all mails as
312.Ql john@hamlet ;
313setting it to
314.Ql percolator
315will send all mails as
316.Sm off
317.Ql Va username @percolator .
318.Sm on
319.It Ic NULLCLIENT Xo
320(boolean, default=commented)
321.Xc
322Bypass aliases and local delivery, and instead forward all mails to
323the defined
324.Sq SMARTHOST .
325.Sq NULLCLIENT
326requires
327.Sq SMARTHOST
328to be set.
329.El
330.Ss Environment variables
331The behavior of
332.Nm
333can be influenced by some environment variables.
334.Bl -tag -width 4n
335.It Ev EMAIL Xo
336.Xc
337Used to set the sender address (envelope-from).
338Use a plain address, in the form of
339.Li user@example.com .
340This value will be overridden when the
341.Sq MASQUERADE
342config file setting or the
343.Fl f
344flag is used.
345.El
346.Sh SEE ALSO
347.Xr mailaddr 7 ,
348.Xr mailwrapper 8 ,
349.Xr sendmail 8
350.Rs
351.%A "J. B. Postel"
352.%T "Simple Mail Transfer Protocol"
353.%O RFC 821
354.Re
355.Rs
356.%A "J. Myers"
357.%T "SMTP Service Extension for Authentication"
358.%O RFC 2554
359.Re
360.Rs
361.%A "P. Hoffman"
362.%T "SMTP Service Extension for Secure SMTP over TLS"
363.%O RFC 2487
364.Re
365.Sh HISTORY
366The
367.Nm
368utility first appeared in
369.Dx 1.11 .
370.Sh AUTHORS
371.An -nosplit
372.Nm
373was written by
374.An Matthias Schmidt Aq Mt matthias@dragonflybsd.org
375and
376.An Simon Schubert Aq Mt 2@0x2c.org .
377