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