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