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