Added references to the whatnow(1) man page description of its
[mmh] / man / send.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH SEND %manext1% "%nmhdate%" MH.6.8 [%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
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 .BR 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 .BR 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 .RI \*(lq \&.netrc \*(rq
399 file can be used to store this password).
400 .B \-saslmech
401 switch can be used to select a particular SASL mechanism,
402 and the the
403 .B \-user
404 switch can be used to select a authorization userid
405 to provide to SASL other than the default.
406 .PP
407 If SASL authentication is successful,
408 .BR nmh
409 will attempt to negotiate a security layer for session encryption.
410 Encrypted data is labelled with `(encrypted)' and `(decrypted)' when
411 viewing the SMTP transaction with the
412 .B \-snoop
413 switch.  The
414 .B \-saslmaxssf
415 switch can be used to select the maximum value of the Security Strength Factor.
416 This is an integer value and the exact meaning of this value depends on the
417 underlying SASL mechanism.  A value of 0 disables encryption.
418 .PP
419 If
420 .B nmh
421 has been compiled with TLS support, the
422 .B \-tls
423 and
424 .B \-notls
425 switches will require and disable the negotiation of TLS support when connecting to the
426 SMTP MTA.  Encrypted data is labelled with `(tls-encrypted)' and
427 `(tls-decrypted)' when viewing the SMTP transction with the
428 .B \-snoop
429 switch.
430 .PP
431 The files specified by the profile entry \*(lqAliasfile:\*(rq and any
432 additional alias files given by the
433 .B \-alias
434 .I aliasfile
435 switch will be
436 read (more than one file, each preceded by
437 .BR \-alias ,
438 can be named).
439 See
440 .BR mh\-alias (5)
441 for more information.
442
443 .SH FILES
444 .fc ^ ~
445 .nf
446 .ta \w'%etcdir%/ExtraBigFileName  'u
447 ^$HOME/\&.mh\(ruprofile~^The user profile
448 .fi
449
450 .SH "PROFILE COMPONENTS"
451 .fc ^ ~
452 .nf
453 .ta 2.4i
454 .ta \w'ExtraBigProfileName  'u
455 ^Path:~^To determine the user's nmh directory
456 ^Draft\-Folder:~^To find the default draft\-folder
457 ^Aliasfile:~^For a default alias file
458 ^Signature:~^To determine the user's mail signature
459 ^mailproc:~^Program to post failure notices
460 ^postproc:~^Program to post the message
461 .fi
462
463 .SH "SEE ALSO"
464 comp(1), dist(1), forw(1), repl(1), mh\-alias(5), mh\-tailor(5), post(8),
465 whatnow(1)
466
467 .SH DEFAULTS
468 .nf
469 .RB ` file "' defaults to <mh\-dir>/draft"
470 .RB ` \-alias "' defaults to %etcdir%/MailAliases"
471 .RB ` \-nodraftfolder '
472 .RB ` \-nofilter '
473 .RB ` \-format '
474 .RB ` \-forward '
475 .RB ` \-nomime '
476 .RB ` \-nomsgid '
477 .RB ` "\-messageid\ localname" '
478 .RB ` \-nopush '
479 .RB ` \-noverbose '
480 .RB ` \-nowatch '
481 .RB ` "\-width\ 72" '
482 .RB ` "\-attach\ Nmh-Attachment" '
483 .RB ` "\-attachformat\ 1" '
484 .fi
485
486 .SH CONTEXT
487 None
488
489 .SH BUGS
490 Under some configurations, it is not possible to monitor the mail delivery
491 transaction;
492 .B \-watch
493 is a no-op on those systems.
494 .PP
495 Using
496 .B \-split
497 .I 0
498 doesn't work correctly.