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