NAME
send - send an nmh messageSYNOPSIS
send
[-help] [-version] [-alias aliasfile]
[-draft] [-draftfolder +folder] [-draftmessage
msg] [-nodraftfolder] [-filter filterfile]
[-nofilter] [-format | -noformat] [-forward |
-noforward] [-mime | -nomime] [-msgid |
-nomsgid] [-messageid localname | random]
[-push | -nopush] [-verbose | -noverbose]
[-watch | -nowatch] [-mts smtp |
sendmail/smtp | sendmail/pipe] [-sendmail program]
[-server servername] [-port port-name/number]
[-sasl] [-nosasl] [-saslmech mechanism]
[-authservice service] [-snoop] [-user
username] [-tls] [-initialtls] [-notls]
[-certverify] [-nocertverify] [-width columns]
[file ...]
DESCRIPTION
send will cause each of the specified files to be delivered to each of the destinations in the “To:”, “cc:”, “Bcc:”, “Dcc:”, and “Fcc:” fields of the message. If send is re-distributing a message, as invoked from dist, then the corresponding “Resent-xxx” fields are examined instead. By default, send uses the program post to do the actual delivery of the messages, although this can be changed by defining the postproc profile component. Most of the features attributed to send are actually performed by post. Before send gives the message to post for delivery, the message is processed by mhbuild to perform any necessary MIME encoding of the outgoing message. This can be changed by the buildmimeproc profile component. mhbuild is invoked with the -auto switch, so mhbuild directives are not processed by default. See mhbuild(1) for more information. mhbuild will scan the message draft for a header named Attach. The draft is converted to a MIME message if one or more matches are found. This conversion occurs before all other processing. whatnow(1) describes the user interface for managing MIME attachments via this mechanism. The first part of the MIME message is the draft body if that body contains any non-blank characters. The body of each Attach header field is interpreted as a file name, and each file named is included as a separate part in the MIME message. Determination of the content MIME type inserted into the Content-Type header for each part depends on how the nmh installation was configured. If a program, such as file with a --mime or -i option, was found that can specify the type of a file as a MIME type string, then that will be used. To determine if your nmh was so configured, run mhparam mimetypeproc and see if a non-empty string is displayed. If your nmh was not configured with a program to specify a file type as a MIME string, then a different method is used to determine the content-type string. This method is also used if the configured mimetypeproc fails to find the MIME type of the content. For file names with dot suffixes, the profile is scanned for a mhshow-suffix- entry for that suffix. The content-type for the part is taken from that profile entry if a match is found. If a match is not found in the user profile, the mhn.defaults profile is scanned next. If no match is found or the file does not have a dot suffix, the content-type is text/plain if the file contains only ASCII characters or application/octet-stream if it contains characters outside of the ASCII range. See mhshow(1) for more details and example syntax. Each attached MIME part contains a “Content-Description” header that includes the filename, and adds a “Content-Disposition” header. Here is an example of MIME part headers for an attachment:Content-Type: text/plain; name="VERSION"; charset="us-ascii" Content-Description: VERSION Content-Disposition: attachment; filename="VERSION"See mhbuild(1) for explanation of how the Content-Disposition value is selected. If -push is specified, send will detach itself from the user's terminal and perform its actions in the background. If push'd and the draft can't be sent, then an error message will be sent (using the mailproc) back to the user. If -forward is given, then a copy of the draft will be attached to this failure notice. Using -push differs from putting send in the background because the output is trapped and analyzed by nmh. If -verbose is specified, send will indicate the interactions occurring with the transport system, prior to actual delivery. If -watch is specified send will monitor the delivery of local and network mail. Hence, by specifying both switches, a large detail of information can be gathered about each step of the message's entry into the transport system. The -draftfolder +folder and -draftmessage msg switches invoke the nmh draft folder facility. This is an advanced (and highly useful) feature. Consult mh-draft(5) for more information. send with no file argument will query whether the draft is the intended file, whereas -draft will suppress this question. Once the transport system has successfully accepted custody of the message, the file will be renamed with a site-dependent prefix (usually a comma), which allows it to be retrieved until the next draft message is sent. If there are errors in the formatting of the message, send will abort with a (hopefully) helpful error message. If a “Bcc:” field is encountered, its addresses will be used for delivery, and the “Bcc:” field will be removed from the message sent to sighted recipients. The blind recipients will receive an entirely new message with a minimal set of headers. The body of this new message will contain a copy of the message sent to the sighted recipients, either marked up with the indicator text "Blind-Carbon-Copy" or encapsulated as a MIME digest. If a “Dcc:” field is encountered and the sendmail/pipe mail transport method is not in use, its addresses will be used for delivery, and the “Dcc:” field will be removed from the message. The blind recipients will receive exactly the same message as the sighted recipients. *WARNING* Recipients listed in the “Dcc:” field receive no explicit indication that they have received a “blind copy”. This can cause blind recipients to inadvertently reply to all of the sighted recipients of the original message, revealing that they received a blind copy. On the other hand, since a normal reply to a message sent via a “Bcc:” field will generate a reply only to the sender of the original message, it takes extra effort in most mailers to reply to the included message, and so would usually only be done deliberately, rather than by accident. If the sendmail/pipe mail transport method is used, then messages containing a “Dcc:” field are rejected.
Selection based on sender address: sendfrom
One or more sendfrom profile components can be used to select a mail server address, mail server port, or any other switch that can be supplied to post. It works by first looking at the sender address and domain name in the message draft, as described below. It then looks for a corresponding profile entry, which contains the post switches. To enable, add profile entries of the form:sendfrom-address/domain name: post
switches
The email address is extracted from the Envelope-From: header, if not blank, the
Sender: header, or the From: header line in the message draft. Multiple
profile entries, with different email addresses or domain names, are
supported. This allows different switches to post, such as -user, to be
associated with different email addresses. If a domain name is used, it
matches all users in that domain.
Here is an example profile entry to use the SMTP on the localhost when the
sender address is clearly local:
sendfrom-localuser@localhost: -server localhost -port smtp
(Indentation indicates a continued line, as supported in MH profiles.) The username need not be the same as the sender address, which was extracted from the appropriate header line as noted above. Here are example profile entries that use an nmh credentials file:
credentials: file:nmhcreds [email protected]: -sasl -tls
-server smtp.sendgrid.net
sendfrom-outbound.att.net: -sasl -initialtls
-server outbound.att.net -port 465
sendfrom-fastmail.com: -initialtls -sasl -saslmech LOGIN
-server smtps-proxy.messagingengine.com -port 80
where nmhcreds is in the user's nmh directory (from the Path profile component) and contains:
machine smtp.sendgrid.net
login [email protected] password ********
machine outbound.att.net
login [email protected] password ********
machine smtps-proxy.messagingengine.com
login [email protected] password ********
For more information on authentication to mail servers, see mhlogin(1) for OAuth services, and mh-profile(5) for login credentials.
FILES
^$HOME/.mh_profile~^The user profile
PROFILE COMPONENTS
^Path:~^To determine the user's nmh directory ^Aliasfile:~^For a default alias file ^Signature:~^To determine the user's mail signature ^mailproc:~^Program to post failure notices ^postproc:~^Program to post the message ^sendfrom-address:~^Switches to post for sender address ^sendfrom-domain:~^Switches to post for sender domain name
SEE ALSO
comp(1), dist(1), file(1), forw(1), mhbuild(1), mhparam(1), mhlogin(1), refile(1), repl(1), whatnow(1), mh-alias(5), mh-profile(5), mh-tailor(5), post(8)DEFAULTS
`file' defaults to <mh-dir>/draft `-alias' defaults to /etc/nmh/MailAliases `-nodraftfolder' `-nofilter' `-format' `-forward' `-nomime' `-nomsgid' `-messageid localname' `-nopush' `-noverbose' `-nowatch' `-width 72' `-certverify'
CONTEXT
NoneBUGS
Under some configurations, it is not possible to monitor the mail delivery transaction; -watch is a no-op on those systems.2022-12-22 | nmh-1.8-RC2 |