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