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