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