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