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