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