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