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