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