25fa35799529e8cda7df0ed3069016e421e84874
[mmh] / man / send.man
1 .\"
2 .\" %nmhwarning%
3 .\" $Id$
4 .\"
5 .TH SEND %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
6 .SH NAME
7 send \- send a message
8 .SH SYNOPSIS
9 .HP 5
10 .na
11 .B send
12 .RB [ \-alias
13 .IR aliasfile ]
14 .RB [ \-draft ]
15 .RB [ \-draftfolder
16 .IR +folder ]
17 .RB [ \-draftmessage
18 .IR msg ]
19 .RB [ \-nodraftfolder ]
20 .RB [ \-filter
21 .IR filterfile ]
22 .RB [ \-nofilter ]
23 .RB [ \-format " | " \-noformat ]
24 .RB [ \-forward " | " \-noforward ]
25 .RB [ \-mime " | " \-nomime ]
26 .RB [ \-msgid " | " \-nomsgid ]
27 .RB [ \-push " | " \-nopush ]
28 .RB [ \-split
29 .IR seconds ]
30 .RB [ \-verbose " | " \-noverbose ]
31 .RB [ \-watch " | " \-nowatch ]
32 .RB [ \-server
33 .IR servername ]
34 .RB [ \-port
35 .IR port-name/number ]
36 .RB [ \-sasl ]
37 .RB [ \-saslmech
38 .IR mechanism ]
39 .RB [ \-user
40 .IR username ]
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 both that and the \*(lqContent-Description\*(rq header, and
120 adds a \*(lqContent-Disposition\*(rq header.  A value of
121 .B 2
122 adds the file
123 .I modification-date
124 parameter to the \*(lqContent-Disposition\*(rq header.  You can
125 specify one value in your profile, and override it for individual
126 messages at the
127 .I whatnow
128 prompt.
129 .PP
130 Here are example message part headers for each of the
131 .B -attachformat
132 values:
133 .PP
134 .nf
135 -attachformat 0:
136 Content-Type: text/plain; name="VERSION"; x-unix-mode="0644";
137         charset="us-ascii"
138 Content-Description: ASCII text 
139
140 -attachformat 1:
141 Content-Type: text/plain; charset="us-ascii"
142 Content-Disposition: attachment; filename="VERSION"
143
144 -attachformat 2:
145 Content-Type: text/plain; charset="us-ascii"
146 Content-Disposition: attachment; filename="VERSION"; modification-date="Mon, 19 Dec 2005 22:39:51 -0600"
147 .fi
148 .PP
149 If
150 .B \-push
151 is specified,
152 .B send
153 will detach itself from the user's
154 terminal and perform its actions in the background.  If
155 .BR push 'd
156 and the draft can't be sent, then an error message will be sent (using
157 the mailproc) back to the user.  If
158 .B \-forward
159 is given, then a copy
160 of the draft will be attached to this failure notice.  Using
161 .B \-push
162 differs from putting
163 .B send
164 in the background because the output is
165 trapped and analyzed by
166 .BR nmh .
167 .PP
168 If
169 .B \-verbose
170 is specified,
171 .B send
172 will indicate the interactions
173 occurring with the transport system, prior to actual delivery.
174 If
175 .B \-watch
176 is specified
177 .B send
178 will monitor the delivery of local
179 and network mail.  Hence, by specifying both switches, a large detail
180 of information can be gathered about each step of the message's entry
181 into the transport system.
182 .PP
183 The
184 .B \-draftfolder
185 .I +folder
186 and
187 .B \-draftmessage
188 .I msg
189 switches invoke
190 the
191 .B nmh
192 draft folder facility.  This is an advanced (and highly
193 useful) feature.  Consult the
194 .BR mh-draft (5)
195 man page for more
196 information.
197 .PP
198 If
199 .B \-split
200 is specified,
201 .B send
202 will split the draft into one
203 or more partial messages prior to sending.  This makes use of the
204 MIME features in
205 .BR nmh .
206 Note however that if
207 .B send
208 is
209 invoked under
210 .BR dist ,
211 then this switch is ignored\0--\0it makes
212 no sense to redistribute a message in this fashion.  Sometimes you want
213 .B send
214 to pause after posting a partial message.  This is usually
215 the case when you are running
216 .B sendmail
217 and expect to generate a
218 lot of partial messages.  The argument to
219 .B \-split
220 tells it how long
221 to pause between postings.
222 .PP
223 .B Send
224 with no
225 .I file
226 argument will query whether the draft
227 is the intended file, whereas
228 .B \-draft
229 will suppress this question.
230 Once the transport system has successfully accepted custody of the
231 message, the file will be renamed with a leading comma, which allows
232 it to be retrieved until the next draft message is sent.  If there are
233 errors in the formatting of the message,
234 .B send
235 will abort with a
236 (hopefully) helpful error message.
237 .PP
238 If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for
239 delivery, and the \*(lqBcc:\*(rq field will be removed from the message
240 sent to sighted recipients.  The blind recipients will receive an entirely
241 new message with a minimal set of headers.  Included in the body of the
242 message will be a copy of the message sent to the sighted recipients.
243 .PP
244 If a \*(lqDcc:\*(rq field is encountered, its addresses will be used for
245 delivery, and the \*(lqDcc:\*(rq field will be removed from the message.  The
246 blind recipients will receive the same message sent to the sighted
247 recipients. *WARNING* Recipients listed in the \*(lqDcc:\*(rq field receive no
248 explicit indication that they have received a \*(lqblind copy\*(rq.
249 This can cause blind recipients to
250 inadvertently reply to all of the sighted recipients of the
251 original message, revealing that they received a blind copy.
252 On the other hand, since a normal reply to a message sent
253 via a \*(lqBcc:\*(rq field
254 will generate a reply only to the sender of the original message,
255 it takes extra effort in most mailers to reply to the included
256 message, and so would usually only be done deliberately, rather
257 than by accident.
258 .PP
259 If
260 .B \-filter
261 .I filterfile
262 is specified, then this copy is filtered
263 (re\-formatted) by
264 .B mhl
265 prior to being sent to the blind recipients.
266 Alternately, if you specify the
267 .B -mime
268 switch, then
269 .B send
270 will
271 use the MIME rules for encapsulation.
272 .PP
273 Prior to sending the message, the fields \*(lqFrom:\ user@local\*(rq,
274 and \*(lqDate:\ now\*(rq will be appended to the headers in the message.
275 If the environment variable
276 .B $SIGNATURE
277 is set, then its value
278 is used as your personal name when constructing the \*(lqFrom:\*(rq
279 line of the message.  If this environment variable is not set, then
280 .B send
281 will consult the profile entry \*(lqSignature\*(rq for
282 this information.
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 If the message already contains a \*(lqFrom:\*(rq field, then a
295 \*(lqSender: user@local\*(rq field will be added as well.  (An already
296 existing \*(lqSender:\*(rq field is an error!)
297 .PP
298 By using the
299 .B \-format
300 switch, each of the entries in the \*(lqTo:\*(rq
301 and \*(lqcc:\*(rq fields will be replaced with \*(lqstandard\*(rq
302 format entries.  This standard format is designed to be usable by all
303 of the message handlers on the various systems around the Internet.
304 If
305 .B \-noformat
306 is given, then headers are output exactly as they appear
307 in the message draft.
308 .PP
309 If an \*(lqFcc:\ folder\*(rq is encountered, the message will be copied
310 to the specified folder for the sender in the format in which it will
311 appear to any non\-Bcc receivers of the message.  That is, it will have
312 the appended fields and field reformatting.  The \*(lqFcc:\*(rq fields
313 will be removed from all outgoing copies of the message.
314 .PP
315 By using the
316 .B \-width
317 .I columns
318 switch, the user can direct
319 .B send
320 as to how long it should make header lines containing addresses.
321 .PP
322 If nmh is using the SMTP MTA, the
323 .B \-server
324 and the
325 .B \-port
326 switches can be used to override the default mail server (defined by the
327 .RI servers
328 entry in
329 .I %etcdir%/mts.conf
330 ).
331 .PP
332 If
333 .B nmh
334 has been compiled with SASL support, the
335 .B \-sasl
336 switch will enable
337 the use of SASL authentication with the SMTP MTA.  Depending on the
338 SASL mechanism used, this may require an additional password prompt from the
339 user (but the
340 .RI \*(lq \&.netrc \*(rq
341 file can be used to store this password).
342 .B \-saslmech
343 switch can be used to select a particular SASL mechanism,
344 and the the
345 .B \-user
346 switch can be used to select a authorization userid
347 to provide to SASL other than the default.
348 .PP
349 If SASL authentication is successful, 
350 .BR nmh
351 will attempt to negotiate a security layer for session encryption.
352 Encrypted data is labelled with `(encrypted)' and `(decrypted)' when
353 viewing the SMTP transaction with the
354 .B \-snoop
355 switch.
356 .PP
357 The files specified by the profile entry \*(lqAliasfile:\*(rq and any
358 additional alias files given by the
359 .B \-alias
360 .I aliasfile
361 switch will be
362 read (more than one file, each preceded by
363 .BR \-alias ,
364 can be named).
365 See
366 .BR mh\-alias (5)
367 for more information.
368
369 .SH FILES
370 .fc ^ ~
371 .nf
372 .ta \w'%etcdir%/ExtraBigFileName  'u
373 ^$HOME/\&.mh\(ruprofile~^The user profile
374 .fi
375
376 .SH "PROFILE COMPONENTS"
377 .fc ^ ~
378 .nf
379 .ta 2.4i
380 .ta \w'ExtraBigProfileName  'u
381 ^Path:~^To determine the user's nmh directory
382 ^Draft\-Folder:~^To find the default draft\-folder
383 ^Aliasfile:~^For a default alias file
384 ^Signature:~^To determine the user's mail signature
385 ^mailproc:~^Program to post failure notices
386 ^postproc:~^Program to post the message
387 .fi
388
389 .SH "SEE ALSO"
390 comp(1), dist(1), forw(1), repl(1), mh\-alias(5), post(8)
391
392 .SH DEFAULTS
393 .nf
394 .RB ` file "' defaults to <mh\-dir>/draft"
395 .RB ` \-alias "' defaults to %etcdir%/MailAliases"
396 .RB ` \-nodraftfolder '
397 .RB ` \-nofilter '
398 .RB ` \-format '
399 .RB ` \-forward '
400 .RB ` \-nomime '
401 .RB ` \-nomsgid '
402 .RB ` \-nopush '
403 .RB ` \-noverbose '
404 .RB ` \-nowatch '
405 .RB ` "\-width\ 72" '
406 .RB ` "\-attachformat\ 0" '
407 .fi
408
409 .SH CONTEXT
410 None
411
412 .SH BUGS
413 Under some configurations, it is not possible to monitor the mail delivery
414 transaction;
415 .B \-watch
416 is a no-op on those systems.
417 .PP
418 Using
419 .B \-split
420 .I 0
421 doesn't work correctly.