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