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