]> diplodocus.org Git - nmh/blob - man/send.man
Removed export of most of the variables in test/common.sh.in. The
[nmh] / man / send.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH SEND %manext1% "July 8, 2014" "%nmhversion%"
5 .SH NAME
6 send \- send a message
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B send
11 .RB [ \-alias
12 .IR aliasfile ]
13 .RB [ \-draft ]
14 .RB [ \-draftfolder
15 .IR +folder ]
16 .RB [ \-draftmessage
17 .IR msg ]
18 .RB [ \-nodraftfolder ]
19 .RB [ \-filter
20 .IR filterfile ]
21 .RB [ \-nofilter ]
22 .RB [ \-format " | " \-noformat ]
23 .RB [ \-forward " | " \-noforward ]
24 .RB [ \-mime " | " \-nomime ]
25 .RB [ \-msgid " | " \-nomsgid ]
26 .RB [ \-messageid
27 .IR localname " | " random ]
28 .RB [ \-push " | " \-nopush ]
29 .RB [ \-split
30 .IR seconds ]
31 .RB [ \-verbose " | " \-noverbose ]
32 .RB [ \-watch " | " \-nowatch ]
33 .RB [ \-mts
34 .IR smtp " | " sendmail/smtp " | " sendmail/pipe ]
35 .RB [ \-server
36 .IR servername ]
37 .RB [ \-port
38 .IR port-name/number ]
39 .RB [ \-sasl ]
40 .RB [ \-nosasl ]
41 .RB [ \-saslmaxssf
42 .IR ssf ]
43 .RB [ \-saslmech
44 .IR mechanism ]
45 .RB [ \-snoop ]
46 .RB [ \-user
47 .IR username ]
48 .RB [ \-tls ]
49 .RB [ \-initialtls ]
50 .RB [ \-notls ]
51 .RB [ \-width
52 .IR columns ]
53 .RB [ file
54 \&...]
55 .RB [ \-version ]
56 .RB [ \-help ]
57 .ad
58 .SH DESCRIPTION
59 .B Send
60 will cause each of the specified files to be delivered
61 to each of the destinations in the \*(lqTo:\*(rq, \*(lqcc:\*(rq,
62 \*(lqBcc:\*(rq, \*(lqDcc:\*(rq, and \*(lqFcc:\*(rq fields of the message. If
63 .B send
64 is re\-distributing a message, as invoked from
65 .BR dist ,
66 then the
67 corresponding \*(lqResent\-xxx\*(rq fields are examined instead.
68 .PP
69 By default,
70 .B send
71 uses the program
72 .B post
73 to do the actual
74 delivery of the messages, although this can be changed by defining the
75 .I postproc
76 profile component. Most of the features attributed to
77 .B send
78 are actually performed by
79 .BR post .
80 .PP
81 Before
82 .B send
83 gives the message to
84 .B post
85 for delivery, the message is processed by
86 .B mhbuild
87 to perform any necessary MIME encoding of the outgoing message. This
88 can be changed by the
89 .I buildmimeproc
90 profile component.
91 .B mhbuild
92 is invoked with the
93 .B \-auto
94 switch, so
95 .B mhbuild
96 directives are not processed by default. See
97 .IR mhbuild (1)
98 for more information.
99 .PP
100 .B mhbuild
101 will scan the message draft for a header named
102 .IR Attach .
103 The draft is converted to a MIME message if one or more matches are found.
104 This conversion occurs before all other processing. The
105 .IR whatnow (1)
106 man page describes the user interface for managing MIME attachments via
107 this mechanism.
108 .PP
109 The first part of the MIME message is the draft body if that body contains
110 any non-blank characters.
111 The body of each
112 .I Attach
113 header field is interpreted as a file name, and each file named is included as a separate
114 part in the MIME message.
115 .PP
116 Determination of the content MIME type inserted into the Content-Type
117 header for each part depends on how the
118 .B nmh
119 installation was configured. If a program, such as
120 .B file
121 with a
122 .B \-\-mime
123 or
124 .B \-i
125 option, was found that can specify the type of a file as a MIME type
126 string, then that will be used. To determine if your
127 .B nmh
128 was so configured, run
129 .B mhparam mimetypeproc
130 and see if a non-empty string is displayed.
131 .PP
132 If your
133 .B nmh
134 was not configured with a program to specify a file type as a MIME
135 string, then a different method is used to determine the content-type
136 string. For file names with dot suffixes, the profile is scanned for a
137 .I mhshow-suffix-
138 entry for that suffix.
139 The content-type for the part is taken from that profile entry if a match is
140 found. If a match is not found in the user profile, the mhn.defaults
141 profile is scanned next.
142 If no match is found or the file does not have a dot suffix, the content-type
143 is text/plain if the file contains only ASCII characters or application/octet-stream
144 if it contains characters outside of the ASCII range. See
145 .IR mhshow (1)
146 for more details and example syntax.
147 .PP
148 Each attached MIME part contains a
149 \*(lqContent-Description\*(rq header that includes the filename, and
150 adds a \*(lqContent-Disposition\*(rq header.
151 Here is an example of MIME part headers for an attachment:
152 .PP
153 .nf
154 Content-Type: text/plain; name="VERSION"; charset="us-ascii"
155 Content-Description: VERSION
156 Content-Disposition: attachment; filename="VERSION"
157 .fi
158 .PP
159 See
160 .IR mhbuild (1)
161 for explanation of how the Content-Disposition value is selected.
162 .PP
163 If
164 .B \-push
165 is specified,
166 .B send
167 will detach itself from the user's
168 terminal and perform its actions in the background. If
169 .BR push 'd
170 and the draft can't be sent, then an error message will be sent (using
171 the mailproc) back to the user. If
172 .B \-forward
173 is given, then a copy
174 of the draft will be attached to this failure notice. Using
175 .B \-push
176 differs from putting
177 .B send
178 in the background because the output is
179 trapped and analyzed by
180 .BR nmh .
181 .PP
182 If
183 .B \-verbose
184 is specified,
185 .B send
186 will indicate the interactions
187 occurring with the transport system, prior to actual delivery.
188 If
189 .B \-watch
190 is specified
191 .B send
192 will monitor the delivery of local
193 and network mail. Hence, by specifying both switches, a large detail
194 of information can be gathered about each step of the message's entry
195 into the transport system.
196 .PP
197 The
198 .B \-draftfolder
199 .I +folder
200 and
201 .B \-draftmessage
202 .I msg
203 switches invoke
204 the
205 .B nmh
206 draft folder facility. This is an advanced (and highly
207 useful) feature. Consult the
208 .IR mh-draft (5)
209 man page for more
210 information.
211 .PP
212 If
213 .B \-split
214 is specified,
215 .B send
216 will split the draft into one
217 or more partial messages prior to sending. This makes use of the
218 MIME features in
219 .BR nmh .
220 Note however that if
221 .B send
222 is
223 invoked under
224 .BR dist ,
225 then this switch is ignored\0--\0it makes
226 no sense to redistribute a message in this fashion. Sometimes you want
227 .B send
228 to pause after posting a partial message. This is usually
229 the case when you are running
230 .B sendmail
231 and expect to generate a
232 lot of partial messages. The argument to
233 .B \-split
234 tells it how long
235 to pause between postings.
236 .PP
237 .B Send
238 with no
239 .I file
240 argument will query whether the draft
241 is the intended file, whereas
242 .B \-draft
243 will suppress this question.
244 Once the transport system has successfully accepted custody of the
245 message, the file will be renamed with a site-dependent prefix
246 (usually a comma), which allows
247 it to be retrieved until the next draft message is sent. If there are
248 errors in the formatting of the message,
249 .B send
250 will abort with a
251 (hopefully) helpful error message.
252 .PP
253 If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for
254 delivery, and the \*(lqBcc:\*(rq field will be removed from the message
255 sent to sighted recipients. The blind recipients will receive an entirely
256 new message with a minimal set of headers. Included in the body of the
257 message will be a copy of the message sent to the sighted recipients.
258 .PP
259 If a \*(lqDcc:\*(rq field is encountered and the
260 .B sendmail/pipe
261 mail transport method is not in use, its addresses will be used for
262 delivery, and the \*(lqDcc:\*(rq field will be removed from the message. The
263 blind recipients will receive the same message sent to the sighted
264 recipients. *WARNING* Recipients listed in the \*(lqDcc:\*(rq field receive no
265 explicit indication that they have received a \*(lqblind copy\*(rq.
266 This can cause blind recipients to
267 inadvertently reply to all of the sighted recipients of the
268 original message, revealing that they received a blind copy.
269 On the other hand, since a normal reply to a message sent
270 via a \*(lqBcc:\*(rq field
271 will generate a reply only to the sender of the original message,
272 it takes extra effort in most mailers to reply to the included
273 message, and so would usually only be done deliberately, rather
274 than by accident.
275 .PP
276 If
277 .B \-filter
278 .I filterfile
279 is specified, then this copy is filtered
280 (re\-formatted) by
281 .B mhl
282 prior to being sent to the blind recipients.
283 Alternately, if you specify the
284 .B -mime
285 switch, then
286 .B send
287 will
288 use the MIME rules for encapsulation.
289 .PP
290 Prior to sending the message, the \*(lqDate:\ now\*(rq field will be appended to the headers in the message.
291 If
292 .B \-msgid
293 is specified, then a \*(lqMessage\-ID:\*(rq field will also
294 be added to the message.
295 .PP
296 The
297 .B \-messageid
298 switch selects the style used for the part appearing after the @
299 in \*(lqMessage\-ID:\*(rq, \*(lqResent\-Message\-ID:\*(rq, and
300 \*(lqContent\-ID:\*(rq header fields. The two acceptable options are
301 .B localname
302 (which is the default),
303 and
304 .BR random .
305 With
306 .BR localname ,
307 the local hostname is used. With
308 .BR random ,
309 a random sequence of characters is used instead. Note that the
310 .B \-msgid
311 switch must be enabled for this switch to have any effect.
312 .PP
313 If
314 .B send
315 is re\-distributing a message (when invoked by
316 .BR dist ),
317 then \*(lqResent\-\*(rq will be prepended to each of these
318 fields: \*(lqFrom:\*(rq, \*(lqDate:\*(rq, and \*(lqMessage\-ID:\*(rq.
319 .PP
320 A \*(lqFrom:\*(rq field is required for all outgoing messages. Multiple
321 addresses are permitted in the \*(lqFrom:\*(rq field, but a \*(lqSender:\*(rq
322 field is required in this case. Otherwise a \*(lqSender:\*(rq field
323 is optional.
324 .PP
325 If a message with multiple \*(lqFrom:\*(rq
326 addresses does
327 .B NOT
328 include a \*(lqSender:\*(rq field but does include an \*(lqEnvelope\-From:\*(rq
329 field, the \*(lqEnvelope\-From:\*(rq field will be used to construct
330 a \*(lqSender:\*(rq field.
331 .PP
332 When using SMTP for mail submission, the envelope\-from used for the SMTP
333 transaction is derived from the \*(lqEnvelope\-From:\*(rq field.
334 If no \*(lqEnvelope\-From:\*(rq field is present, the \*(lqSender:\*(rq
335 field is used. If neither the \*(lqEnvelope\-From:\*(rq nor the
336 \*(lqSender:\*(rq field is present, the \*(lqFrom:\*(rq field is used.
337 When \*(lqEnvelope\-From:\*(rq appears in a message
338 it will be removed from the final outgoing message.
339 .PP
340 By using the
341 .B \-format
342 switch, each of the entries in the \*(lqTo:\*(rq
343 and \*(lqcc:\*(rq fields will be replaced with \*(lqstandard\*(rq
344 format entries. This standard format is designed to be usable by all
345 of the message handlers on the various systems around the Internet.
346 If
347 .B \-noformat
348 is given, then headers are output exactly as they appear
349 in the message draft.
350 .PP
351 If an \*(lqFcc:\ folder\*(rq is encountered, the message will be copied
352 to the specified folder for the sender in the format in which it will
353 appear to any non\-Bcc receivers of the message. That is, it will have
354 the appended fields and field reformatting. The \*(lqFcc:\*(rq fields
355 will be removed from all outgoing copies of the message.
356 .PP
357 By using the
358 .B \-width
359 .I columns
360 switch, the user can direct
361 .B send
362 as to how long it should make header lines containing addresses.
363 .PP
364 The mail transport system default is provided in
365 .I %nmhetcdir%/mts.conf
366 but can be overriiden here with the
367 .B \-mts
368 switch.
369 .PP
370 If nmh is using the SMTP MTA, the
371 .B \-server
372 and the
373 .B \-port
374 switches can be used to override the default mail server (defined by the
375 .I %nmhetcdir%/mts.conf
376 .RI servers
377 entry). The
378 .B \-snoop
379 switch can be used to view the SMTP transaction. (Beware that the
380 SMTP transaction may contain authentication information either in
381 plaintext or easily decoded base64.)
382 .PP
383 If
384 .B nmh
385 has been compiled with SASL support, the
386 .B \-sasl
387 and
388 .B \-nosasl
389 switches will enable and disable
390 the use of SASL authentication with the SMTP MTA. Depending on the
391 SASL mechanism used, this may require an additional password prompt from the
392 user (but the
393 .I netrc
394 file can be used to store this password, as described in the
395 mh-profile(5) man page). The
396 .B \-saslmech
397 switch can be used to select a particular SASL mechanism,
398 and the
399 .B \-user
400 switch can be used to select a authorization userid to provide to SASL
401 other than the default. The credentials profile entry in the
402 mh\-profile(5) man page describes the ways to supply a username and
403 password.
404 .PP
405 If SASL authentication is successful,
406 .BR nmh
407 will attempt to negotiate a security layer for session encryption.
408 Encrypted data is labelled with `(encrypted)' and `(decrypted)' when
409 viewing the SMTP transaction with the
410 .B \-snoop
411 switch. The
412 .B \-saslmaxssf
413 switch can be used to select the maximum value of the Security Strength Factor.
414 This is an integer value and the exact meaning of this value depends on the
415 underlying SASL mechanism. A value of 0 disables encryption.
416 .PP
417 If
418 .B nmh
419 has been compiled with TLS support, the
420 .B \-tls
421 and
422 .B \-initialtls
423 switches will require the negotiation of TLS when
424 connecting to the SMTP MTA. The
425 .B \-tls
426 switch will negotiate TLS as part of the normal SMTP protocol
427 using the STARTTLS command. The
428 .B \-initialtls
429 will negotiate TLS immediately after the connection has
430 taken place, before any SMTP commands are sent or received. Encrypted data
431 is labelled with `(tls-encrypted)' and
432 `(tls-decrypted)' when viewing the SMTP transction with the
433 .B \-snoop
434 switch.
435 The
436 .B \-notls
437 switch will disable all attempts to negotiate TLS.
438 .PP
439 If port 465 is specified and none of the TLS switches were enabled,
440 .B \-initialtls
441 will be implied if TLS support was compiled in. Though port 465 for
442 SMTPS (SMTP over SSL) was deregistered by IANA in 1998, it is still
443 used for that service.
444 .PP
445 The files specified by the profile entry \*(lqAliasfile:\*(rq and any
446 additional alias files given by the
447 .B \-alias
448 .I aliasfile
449 switch will be
450 read (more than one file, each preceded by
451 .BR \-alias ,
452 can be named).
453 See
454 .IR mh\-alias (5)
455 for more information.
456 .SH FILES
457 .fc ^ ~
458 .nf
459 .ta \w'%nmhetcdir%/ExtraBigFileName 'u
460 ^$HOME/\&.mh\(ruprofile~^The user profile
461 .fi
462 .SH "PROFILE COMPONENTS"
463 .fc ^ ~
464 .nf
465 .ta 2.4i
466 .ta \w'ExtraBigProfileName 'u
467 ^Path:~^To determine the user's nmh directory
468 ^Draft\-Folder:~^To find the default draft\-folder
469 ^Aliasfile:~^For a default alias file
470 ^Signature:~^To determine the user's mail signature
471 ^mailproc:~^Program to post failure notices
472 ^postproc:~^Program to post the message
473 .fi
474 .SH "SEE ALSO"
475 .IR comp (1),
476 .IR dist (1),
477 .IR file (1),
478 .IR forw (1),
479 .IR mhbuild (1),
480 .IR mhparam (1),
481 .IR repl (1),
482 .IR whatnow (1),
483 .IR mh\-alias (5),
484 .IR mh\-profile (5),
485 .IR mh\-tailor (5),
486 .IR post (8)
487 .SH DEFAULTS
488 .nf
489 .RB ` file "' defaults to <mh\-dir>/draft"
490 .RB ` \-alias "' defaults to %nmhetcdir%/MailAliases"
491 .RB ` \-nodraftfolder '
492 .RB ` \-nofilter '
493 .RB ` \-format '
494 .RB ` \-forward '
495 .RB ` \-nomime '
496 .RB ` \-nomsgid '
497 .RB ` "\-messageid\ localname" '
498 .RB ` \-nopush '
499 .RB ` \-noverbose '
500 .RB ` \-nowatch '
501 .RB ` "\-width\ 72" '
502 .fi
503 .SH CONTEXT
504 None
505 .SH BUGS
506 Under some configurations, it is not possible to monitor the mail delivery
507 transaction;
508 .B \-watch
509 is a no-op on those systems.
510 .PP
511 Using
512 .B \-split
513 .I 0
514 doesn't work correctly.