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