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