]> diplodocus.org Git - nmh/blob - man/send.man
Reorder configure options to be before variables
[nmh] / man / send.man
1 .TH SEND %manext1% 2017-05-11 "%nmhversion%"
2 .
3 .\" %nmhwarning%
4 .
5 .SH NAME
6 send \- send an nmh message
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B send
11 .RB [ \-help ]
12 .RB [ \-version ]
13 .RB [ \-alias
14 .IR aliasfile ]
15 .RB [ \-draft ]
16 .RB [ \-draftfolder
17 .IR +folder ]
18 .RB [ \-draftmessage
19 .IR msg ]
20 .RB [ \-nodraftfolder ]
21 .RB [ \-filter
22 .IR filterfile ]
23 .RB [ \-nofilter ]
24 .RB [ \-format " | " \-noformat ]
25 .RB [ \-forward " | " \-noforward ]
26 .RB [ \-mime " | " \-nomime ]
27 .RB [ \-msgid " | " \-nomsgid ]
28 .RB [ \-messageid
29 .IR localname " | " random ]
30 .RB [ \-push " | " \-nopush ]
31 .RB [ \-verbose " | " \-noverbose ]
32 .RB [ \-watch " | " \-nowatch ]
33 .RB [ \-mts
34 .IR smtp " | " sendmail/smtp " | " sendmail/pipe ]
35 .RB [ \-sendmail
36 .IR program ]
37 .RB [ \-server
38 .IR servername ]
39 .RB [ \-port
40 .IR port-name/number ]
41 .RB [ \-sasl ]
42 .RB [ \-nosasl ]
43 .RB [ \-saslmech
44 .IR mechanism ]
45 .RB [ \-authservice
46 .IR service ]
47 .RB [ \-snoop ]
48 .RB [ \-user
49 .IR username ]
50 .RB [ \-tls ]
51 .RB [ \-initialtls ]
52 .RB [ \-notls ]
53 .RB [ \-certverify ]
54 .RB [ \-nocertverify ]
55 .RB [ \-width
56 .IR columns ]
57 .RB [ file
58 \&...]
59 .ad
60 .SH DESCRIPTION
61 .B send
62 will cause each of the specified files to be delivered
63 to each of the destinations in the \*(lqTo:\*(rq, \*(lqcc:\*(rq,
64 \*(lqBcc:\*(rq, \*(lqDcc:\*(rq, and \*(lqFcc:\*(rq fields of the message. If
65 .B send
66 is re-distributing a message, as invoked from
67 .BR dist ,
68 then the
69 corresponding \*(lqResent\-xxx\*(rq fields are examined instead.
70 .PP
71 By default,
72 .B send
73 uses the program
74 .B post
75 to do the actual
76 delivery of the messages, although this can be changed by defining the
77 .I postproc
78 profile component. Most of the features attributed to
79 .B send
80 are actually performed by
81 .BR post .
82 .PP
83 Before
84 .B send
85 gives the message to
86 .B post
87 for delivery, the message is processed by
88 .B mhbuild
89 to perform any necessary MIME encoding of the outgoing message. This
90 can be changed by the
91 .I buildmimeproc
92 profile component.
93 .B mhbuild
94 is invoked with the
95 .B \-auto
96 switch, so
97 .B mhbuild
98 directives are not processed by default. See
99 .IR mhbuild (1)
100 for more information.
101 .PP
102 .B mhbuild
103 will scan the message draft for a header named
104 .IR Attach .
105 The draft is converted to a MIME message if one or more matches are found.
106 This conversion occurs before all other processing.
107 .IR whatnow (1)
108 describes the user interface for managing MIME attachments via
109 this mechanism.
110 .PP
111 The first part of the MIME message is the draft body if that body contains
112 any non-blank characters.
113 The body of each
114 .I Attach
115 header field is interpreted as a file name, and each file named is included as a separate
116 part in the MIME message.
117 .PP
118 Determination of the content MIME type inserted into the Content-Type
119 header for each part depends on how the
120 .B nmh
121 installation was configured. If a program, such as
122 .B file
123 with a
124 .B \-\-mime
125 or
126 .B \-i
127 option, was found that can specify the type of a file as a MIME type
128 string, then that will be used. To determine if your
129 .B nmh
130 was so configured, run
131 .B mhparam mimetypeproc
132 and see if a non-empty string is displayed.
133 .PP
134 If your
135 .B nmh
136 was not configured with a program to specify a file type as a MIME
137 string, then a different method is used to determine the content-type
138 string. For file names with dot suffixes, the profile is scanned for a
139 .I mhshow-suffix-
140 entry for that suffix.
141 The content-type for the part is taken from that profile entry if a match is
142 found. If a match is not found in the user profile, the mhn.defaults
143 profile is scanned next.
144 If no match is found or the file does not have a dot suffix, the content-type
145 is text/plain if the file contains only ASCII characters or application/octet-stream
146 if it contains characters outside of the ASCII range. See
147 .IR mhshow (1)
148 for more details and example syntax.
149 .PP
150 Each attached MIME part contains a
151 \*(lqContent-Description\*(rq header that includes the filename, and
152 adds a \*(lqContent-Disposition\*(rq header.
153 Here is an example of MIME part headers for an attachment:
154 .PP
155 .nf
156 Content-Type: text/plain; name="VERSION"; charset="us-ascii"
157 Content-Description: VERSION
158 Content-Disposition: attachment; filename="VERSION"
159 .fi
160 .PP
161 See
162 .IR mhbuild (1)
163 for explanation of how the Content-Disposition value is selected.
164 .PP
165 If
166 .B \-push
167 is specified,
168 .B send
169 will detach itself from the user's
170 terminal and perform its actions in the background. If
171 .BR push 'd
172 and the draft can't be sent, then an error message will be sent (using
173 the mailproc) back to the user. If
174 .B \-forward
175 is given, then a copy
176 of the draft will be attached to this failure notice. Using
177 .B \-push
178 differs from putting
179 .B send
180 in the background because the output is
181 trapped and analyzed by
182 .BR nmh .
183 .PP
184 If
185 .B \-verbose
186 is specified,
187 .B send
188 will indicate the interactions
189 occurring with the transport system, prior to actual delivery.
190 If
191 .B \-watch
192 is specified
193 .B send
194 will monitor the delivery of local
195 and network mail. Hence, by specifying both switches, a large detail
196 of information can be gathered about each step of the message's entry
197 into the transport system.
198 .PP
199 The
200 .B \-draftfolder
201 .I +folder
202 and
203 .B \-draftmessage
204 .I msg
205 switches invoke
206 the
207 .B nmh
208 draft folder facility. This is an advanced (and highly
209 useful) feature. Consult
210 .IR mh-draft (5)
211 for more
212 information.
213 .PP
214 .B send
215 with no
216 .I file
217 argument will query whether the draft
218 is the intended file, whereas
219 .B \-draft
220 will suppress this question.
221 Once the transport system has successfully accepted custody of the
222 message, the file will be renamed with a site-dependent prefix
223 (usually a comma), which allows
224 it to be retrieved until the next draft message is sent. If there are
225 errors in the formatting of the message,
226 .B send
227 will abort with a
228 (hopefully) helpful error message.
229 .PP
230 If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for
231 delivery, and the \*(lqBcc:\*(rq field will be removed from the message
232 sent to sighted recipients. The blind recipients will receive an entirely
233 new message with a minimal set of headers. The body of this new message
234 will contain a copy of the message sent to the sighted recipients, either
235 marked up with the indicator text "Blind-Carbon-Copy" or encapsulated
236 as a MIME digest.
237 .PP
238 If a \*(lqDcc:\*(rq field is encountered and the
239 .B sendmail/pipe
240 mail transport method is not in use, 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 exactly the same message as 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 the
256 .B sendmail/pipe
257 mail transport method is used, then messages containing
258 a \*(lqDcc:\*(rq field are rejected.
259
260 .PP
261 If
262 .B \-filter
263 .I filterfile
264 is specified, then this copy is filtered
265 (re-formatted) by
266 .B mhl
267 prior to being sent to the blind recipients.
268 Alternately, if you specify the
269 .B -mime
270 switch, then
271 .B send
272 will
273 use the MIME rules for encapsulation.
274 .PP
275 Prior to sending the message, the \*(lqDate:\ now\*(rq field will be appended to the headers in the message.
276 If
277 .B \-msgid
278 is specified, then a \*(lqMessage\-ID:\*(rq field will also
279 be added to the message.
280 .PP
281 The
282 .B \-messageid
283 switch selects the style used for the part appearing after the @
284 in \*(lqMessage\-ID:\*(rq, \*(lqResent\-Message\-ID:\*(rq, and
285 \*(lqContent\-ID:\*(rq header fields. The two acceptable options are
286 .B localname
287 (which is the default),
288 and
289 .BR random .
290 With
291 .BR localname ,
292 the local hostname is used. With
293 .BR random ,
294 a random sequence of characters is used instead. Note that the
295 .B \-msgid
296 switch must be enabled for this switch to have any effect.
297 .PP
298 If
299 .B send
300 is re-distributing a message (when invoked by
301 .BR dist ),
302 then \*(lqResent\-\*(rq will be prepended to each of these
303 fields: \*(lqFrom:\*(rq, \*(lqDate:\*(rq, and \*(lqMessage\-ID:\*(rq.
304 .PP
305 A \*(lqFrom:\*(rq field is required for all outgoing messages. Multiple
306 addresses are permitted in the \*(lqFrom:\*(rq field, but a \*(lqSender:\*(rq
307 field is required in this case. Otherwise a \*(lqSender:\*(rq field
308 is optional.
309 .PP
310 If a message with multiple \*(lqFrom:\*(rq
311 addresses does
312 .I not
313 include a \*(lqSender:\*(rq field but does include an \*(lqEnvelope\-From:\*(rq
314 field, the \*(lqEnvelope\-From:\*(rq field will be used to construct
315 a \*(lqSender:\*(rq field.
316 .PP
317 When using SMTP for mail submission, the envelope-from used for the SMTP
318 transaction is derived from the \*(lqEnvelope\-From:\*(rq field.
319 If no \*(lqEnvelope\-From:\*(rq field is present, the \*(lqSender:\*(rq
320 field is used. If neither the \*(lqEnvelope\-From:\*(rq nor the
321 \*(lqSender:\*(rq field is present, the \*(lqFrom:\*(rq field is used.
322 When \*(lqEnvelope\-From:\*(rq appears in a message
323 it will be removed from the final outgoing message.
324 .PP
325 By using the
326 .B \-format
327 switch, each of the entries in the \*(lqTo:\*(rq
328 and \*(lqcc:\*(rq fields will be replaced with \*(lqstandard\*(rq
329 format entries. This standard format is designed to be usable by all
330 of the message handlers on the various systems around the Internet.
331 If
332 .B \-noformat
333 is given, then headers are output exactly as they appear
334 in the message draft.
335 .PP
336 If an \*(lqFcc:\ folder\*(rq is encountered, the message will be copied
337 to the specified folder for the sender in the format in which it will
338 appear to any non\-Bcc receivers of the message. That is, it will have
339 the appended fields and field reformatting. The \*(lqFcc:\*(rq fields
340 will be removed from all outgoing copies of the message.
341 .PP
342 Beware that if an \*(lqFcc:\*(rq with one or more folders is present
343 but none of the folders exist, and the default
344 .I fileproc
345 and
346 .I postproc
347 are in use, then
348 .B refile
349 will prompt the user to create the folder(s) if
350 .B \-push
351 is not specified. If all responses are negative, or creation of each folder
352 fails, or
353 .B \-push
354 is specified, the message will not be copied to any folder and will be
355 removed by
356 .BR post .
357 With the default
358 .B refile
359 switches, the message draft will be renamed according to the specification
360 of its
361 .B \-nolink
362 switch.
363 .PP
364 By using the
365 .B \-width
366 .I columns
367 switch, the user can direct
368 .B send
369 as to how long it should make header lines containing addresses.
370 .PP
371 The mail transport system default is provided in
372 .I %nmhetcdir%/mts.conf
373 but can be overridden here with the
374 .B \-mts
375 switch.
376 .PP
377 If nmh is using
378 .B sendmail/pipe
379 or
380 .B sendmail/smtp
381 as its mail transport system, the
382 .B \-sendmail
383 switch can be used to override the default
384 .B sendmail
385 program.
386 .PP
387 If nmh is using the SMTP MTA, the
388 .B \-server
389 and the
390 .B \-port
391 switches can be used to override the default mail server (defined by the
392 .I %nmhetcdir%/mts.conf
393 .I servers
394 entry). The
395 .B \-snoop
396 switch can be used to view the SMTP transaction. (Beware that the
397 SMTP transaction may contain authentication information either in
398 plaintext or easily decoded base64.) If
399 .B \-sasl \-saslmech xoauth2
400 is used, the HTTP transaction is also shown.
401 .PP
402 If
403 .B nmh
404 has been compiled with SASL support, the
405 .B \-sasl
406 and
407 .B \-nosasl
408 switches will enable and disable
409 the use of SASL authentication with the SMTP MTA. Depending on the
410 SASL mechanism used, this may require an additional password prompt from the
411 user (but the
412 .I netrc
413 file can be used to store this password, as described in
414 .IR mh-profile (5).
415 The
416 .B \-saslmech
417 switch can be used to select a particular SASL mechanism,
418 and the
419 .B \-user
420 switch can be used to select a authorization userid to provide to SASL
421 other than the default. The credentials profile entry in
422 .IR mh\-profile (5)
423 describes the ways to supply a username and
424 password.
425 .PP
426 If SASL authentication is successful,
427 nmh
428 will attempt to negotiate a security layer for session encryption.
429 Encrypted data is labelled with `(encrypted)' and `(decrypted)' when
430 viewing the SMTP transaction with the
431 .B \-snoop
432 switch; see
433 .IR post (8)'s
434 description of
435 .B \-snoop
436 for its other features.
437 .PP
438 If
439 .B nmh
440 has been compiled with OAuth support, the
441 .B \-sasl
442 and
443 .B \-saslmech xoauth2
444 switches will enable OAuth authentication. The
445 .B \-user
446 switch must be used, and the
447 .I username
448 must be an email address the user has for the service, which must
449 be specified with the
450 .B \-authservice
451 .I service
452 switch. Before using OAuth authentication, the user must authorize nmh by
453 running
454 .B mhlogin
455 and grant authorization to that account. See
456 .IR mhlogin (1)
457 for more details.
458 .PP
459 If
460 .B nmh
461 has been compiled with TLS support, the
462 .B \-tls
463 and
464 .B \-initialtls
465 switches will require the negotiation of TLS when
466 connecting to the SMTP MTA. The
467 .B \-tls
468 switch will negotiate TLS as part of the normal SMTP protocol
469 using the STARTTLS command. The
470 .B \-initialtls
471 will negotiate TLS immediately after the connection has
472 taken place, before any SMTP commands are sent or received. Encrypted data
473 is labelled with `(tls-encrypted)' and
474 `(tls-decrypted)' when viewing the SMTP transaction with the
475 .B \-snoop
476 switch; see
477 .IR post (8)'s
478 description of
479 .B \-snoop
480 for its other features.
481 The
482 .B \-notls
483 switch will disable all attempts to negotiate TLS.
484 .PP
485 If port 465 is specified and none of the TLS switches were enabled,
486 .B \-initialtls
487 will be implied if TLS support was compiled in. Though port 465 for
488 SMTPS (SMTP over SSL) was deregistered by IANA in 1998, it is still
489 used for that service.
490 .PP
491 When using TLS the default is to verify the remote certificate and SubjectName
492 against the local trusted certificate store. This can be controlled by
493 the
494 .B \-certverify
495 and
496 .B \-nocertverify
497 switches. See your OpenSSL documentation for more information on certificate
498 verification.
499 .PP
500 The files specified by the profile entry \*(lqAliasfile:\*(rq and any
501 additional alias files given by the
502 .B \-alias
503 .I aliasfile
504 switch will be
505 read (more than one file, each preceded by
506 .BR \-alias ,
507 can be named).
508 See
509 .IR mh\-alias (5)
510 for more information.
511 .SS Selection based on sender address: sendfrom
512 One or more
513 .I sendfrom
514 profile components can be used to select a mail server address, mail server
515 port, or any other switch that can be supplied to
516 .BR post .
517 It works by first looking at the sender address and domain name in the
518 message draft, as described below.
519 It then looks for a corresponding profile entry, which contains the
520 .B post
521 switches.
522 To enable, add profile entries of the form:
523 .PP
524 .RS 5
525 .RI sendfrom- "address/domain name" : " post switches"
526 .RE
527 .PP
528 The email address is extracted from the Envelope-From: header, if not blank,
529 the Sender: header, or the From: header line in the message draft.
530 Multiple profile entries, with different email addresses or domain names, are
531 supported.
532 This allows different switches to
533 .BR post ,
534 such as -user, to be associated with different email addresses.
535 If a domain name is used, it matches all users in that domain.
536 .PP
537 Here is an example profile entry using OAuth for an account hosted by gmail:
538 .PP
539 .nf
540 .RS 5
541 sendfrom-gmail_address@example.com: -sasl -saslmech xoauth2
542 .RS 5
543 -authservice gmail -tls -server smtp.gmail.com
544 -user gmail_login@example.com
545 .RE
546 .RE
547 .fi
548 .PP
549 (Indentation indicates a continued line, as supported in MH profiles.)
550 The username need not be the same as the sender address, which was extracted
551 from the appropriate header line as noted above.
552 .PP
553 Here are example profile entries that use an nmh credentials file:
554 .PP
555 .nf
556 .RS 5
557 credentials: file:nmhcreds
558 sendfrom-sendgrid_address@example.com: -sasl -tls
559 .RS 5
560 -server smtp.sendgrid.net
561 .RE
562 sendfrom-outbound.att.net: -sasl -initialtls
563 .RS 5
564 -server outbound.att.net -port 465
565 .RE
566 sendfrom-fastmail.com: -initialtls -sasl -saslmech LOGIN
567 .RS 5
568 -server smtps-proxy.messagingengine.com -port 80
569 .RE
570 .RE
571 .fi
572 .PP
573 where nmhcreds is in the user's nmh directory (from the Path profile component)
574 and contains:
575 .PP
576 .nf
577 .RS 5
578 machine smtp.sendgrid.net
579 .RS 5
580 login sendgrid_login@example.com
581 password ********
582 .RE
583 machine outbound.att.net
584 .RS 5
585 login att_login@example.com
586 password ********
587 .RE
588 machine smtps-proxy.messagingengine.com
589 .RS 5
590 login fastmail_login@example.com
591 password ********
592 .RE
593 .RE
594 .fi
595 .PP
596 For more information on authentication to mail servers, see
597 .IR mhlogin (1)
598 for OAuth services, and
599 .IR mh-profile (5)
600 for login credentials.
601 .PP
602 .SH FILES
603 .fc ^ ~
604 .nf
605 .ta \w'%nmhetcdir%/ExtraBigFileName 'u
606 ^$HOME/.mh_profile~^The user profile
607 .fi
608 .SH "PROFILE COMPONENTS"
609 .fc ^ ~
610 .nf
611 .ta 2.4i
612 .ta \w'ExtraBigProfileName 'u
613 ^Path:~^To determine the user's nmh directory
614 ^Draft\-Folder:~^To find the default draft-folder
615 ^Aliasfile:~^For a default alias file
616 ^Signature:~^To determine the user's mail signature
617 ^mailproc:~^Program to post failure notices
618 ^postproc:~^Program to post the message
619 ^sendfrom-address:~^Switches to post for sender address
620 ^sendfrom-domain:~^Switches to post for sender domain name
621 .fi
622 .SH "SEE ALSO"
623 .IR comp (1),
624 .IR dist (1),
625 .IR file (1),
626 .IR forw (1),
627 .IR mhbuild (1),
628 .IR mhparam (1),
629 .IR mhlogin (1),
630 .IR refile (1),
631 .IR repl (1),
632 .IR whatnow (1),
633 .IR mh\-alias (5),
634 .IR mh\-profile (5),
635 .IR mh\-tailor (5),
636 .IR post (8)
637 .SH DEFAULTS
638 .nf
639 .RB ` file "' defaults to <mh-dir>/draft"
640 .RB ` \-alias "' defaults to %nmhetcdir%/MailAliases"
641 .RB ` \-nodraftfolder '
642 .RB ` \-nofilter '
643 .RB ` \-format '
644 .RB ` \-forward '
645 .RB ` \-nomime '
646 .RB ` \-nomsgid '
647 .RB ` "\-messageid\ localname" '
648 .RB ` \-nopush '
649 .RB ` \-noverbose '
650 .RB ` \-nowatch '
651 .RB ` "\-width\ 72" '
652 .RB ` \-certverify '
653 .fi
654 .SH CONTEXT
655 None
656 .SH BUGS
657 Under some configurations, it is not possible to monitor the mail delivery
658 transaction;
659 .B \-watch
660 is a no-op on those systems.