]> diplodocus.org Git - nmh/blobdiff - man/post.man
Don't `else' after return. Simplify control flow.
[nmh] / man / post.man
index 772bbfb94d9c57e0aa8624b6d4ce26c01ba814ed..372108fe02e7585872cc4314e788aea71006e4b8 100644 (file)
@@ -1,14 +1,15 @@
+.TH POST %manext8% "October 17, 2016" "%nmhversion%"
 .\"
 .\" %nmhwarning%
-.\" $Id$
 .\"
-.TH POST %manext8% "%nmhdate%" MH.6.8 [%nmhversion%]
 .SH NAME
 post \- deliver a message
 .SH SYNOPSIS
 .HP 5
 .na
-.B %libdir%/post 
+.B %nmhlibexecdir%/post 
+.RB [ \-help ]
+.RB [ \-version ]
 .RB [ \-alias
 .IR aliasfile ]
 .RB [ \-filter
@@ -17,18 +18,30 @@ post \- deliver a message
 .RB [ \-format " | " \-noformat ]
 .RB [ \-mime " | " \-nomime ]
 .RB [ \-msgid " | " \-nomsgid ]
+.RB [ \-messageid
+.IR localname " | " random ]
 .RB [ \-verbose " | " \-noverbose ]
 .RB [ \-watch " | " \-nowatch ]
 .RB [ \-width
 .IR columns ]
+.RB [ \-mts
+.IR smtp " | " sendmail/smtp " | " sendmail/pipe ]
+.RB [ \-sendmail
+.IR program ]
+.RB [ \-server
+.IR servername ]
+.RB [ \-port
+.IR portname/number ]
 .RB [ \-sasl ]
+.RB [ \-nosasl ]
 .RB [ \-saslmech
 .IR mechanism ]
 .RB [ \-user
 .IR username ]
+.RB [ \-tls ]
+.RB [ \-initialtls ]
+.RB [ \-notls ]
 .I file
-.RB [ \-version ]
-.RB [ \-help ]
 .ad
 .SH DESCRIPTION
 .B Post
@@ -47,10 +60,16 @@ with
 acting as a relatively simple preprocessor.
 Thus, it is
 .B post
-which parses the various header fields, appends
-\*(lqFrom:\*(rq and \*(lqDate:\*(rq lines, and interacts with the mail transport system.
-.B Post
-will not normally be called directly by the user.
+which parses the various header fields, appends a
+\*(lqDate:\*(rq line, and interacts with the mail transport system.
+.B post
+will not normally be called directly by the user,
+but can be replaced by the user with a
+.I postproc
+profile component that will have
+.I file
+as its final argument.
+See the mh-profile(5) man page for more information on postproc.
 .PP
 .B Post
 searches the \*(lqTo:\*(rq, \*(lqcc:\*(rq, \*(lqBcc:\*(rq,
@@ -102,6 +121,23 @@ switch indicates that a \*(lqMessage\-ID:\*(rq or
 \*(lqResent\-Message\-ID:\*(rq field should be added to the header.
 .PP
 The
+.B \-messageid
+switch selects the style used for the part appearing after the @
+in \*(lqMessage\-ID:\*(rq, \*(lqResent\-Message\-ID:\*(rq, and
+\*(lqContent\-ID:\*(rq header fields.  The two acceptable options are
+.B localname
+(which is the default),
+and
+.BR random .
+With
+.BR localname ,
+the local hostname is used.  With
+.BR random ,
+a random sequence of characters is used instead.  Note that the
+.B \-msgid
+switch must be enabled for this switch to have any effect.
+.PP
+The
 .B \-verbose
 switch indicates that the user should be informed of
 each step of the posting/filing process.
@@ -114,72 +150,53 @@ delivery).
 .PP
 Under normal circumstances,
 .B post
-constructs the \*(lqFrom:\*(rq line of the
-message from the user's login name, the full name from the GECOS field of the
-passwd file, and the fully\-qualified name of the local machine (or the
-value of
-\*(lqlocalname\*(rq in
-.IR mts.conf ,
-if set).  An example is \*(lqFrom: Dan Harkless
-<dan@machine.company.com>\*(rq.  There are four ways to override these values,
-however.  Note that they apply equally to \*(lqResent\-From:\*(rq lines in messages sent
+uses the \*(lqFrom:\*(rq line in the message draft as the identity of
+the originating mailbox.  A \*(lqFrom:\*(rq line is required in
+all message draft.  By default the message composition utilities such
+as
+.BR comp ,
+.B repl
+and
+.B mhmail
+will automatically place a \*(lqFrom:\*(rq line in the message draft.
+There are two ways to override this behavior, however.
+Note that they apply equally to \*(lqResent\-From:\*(rq lines in messages sent
 with
 .BR dist .
 .PP
-The first way is GECOS\-based username masquerading.  If the \*(lqmasquerade:\*(rq line
-in
-.I mts.conf
-contains \*(lqmmailid\*(rq, this processing is activated.  If a user's GECOS
-field in the passwd file is of the form \*(lqFull Name <fakename>\*(rq then \*(lqfakename\*(rq
-will be used in place of the real username.  For instance, a GECOS field of \*(lqDan
-Harkless <Dan.Harkless>\*(rq would result in \*(lqFrom: Dan Harkless
-<Dan.Harkless@machine.company.com>\*(rq.  Naturally if you were doing something like
-this you'd want to set up an MTA alias (e.g. in /etc/aliases) from, for
-instance, \*(lqDan.Harkless\*(rq to \*(lqdan\*(rq.
+The first way is to supply a \*(lqSender:\*(rq line.  The value of this
+field will be used as the originating mailbox identity when submitting the
+message to the mail transport system.  If multiple addresses are
+given in the \*(lqFrom:\*(rq line, a \*(lqSender:\*(rq line is
+.BR required .
+If an \*(lqEnvelope-From:\*(rq line is supplied when multiple addresses
+are given in the \*(lqFrom:\*(rq line, a \*(lqSender:\*(rq header will
+be generated using the value of the \*(lqEnvelope-From:\*(rq line,
+.B if
+the \*(lqEnvelope-From:\*(rq line is not blank.
 .PP
-The second way to override default construction of \*(lqFrom:\*(rq is to set the
-.B $SIGNATURE
-environment variable.  This variable overrides the full name
-from the GECOS field, even if GECOS\-based masquerading is being done.  This
-processing is always active, and does not need to be enabled from
-.IR mts.conf .
+The second way is to supply a \*(lqEnvelope-From:\*(rq line.  The value
+of this field will be used as the originating mailbox identity when
+submitting the message to the mail transport system.  This will override
+both the value of the \*(lqFrom:\*(rq line and a \*(lqSender:\*(rq line
+(if one is supplied).  The \*(lqEnvelope-From:\*(rq line is allowed to
+have a blank value; if the value is blank, then the mail transport system
+will be instructed to not send any bounces in response to the message.
+Not all mail transport systems support this feature.
 .PP
-The third way is controlled by the \*(lquser_extension\*(rq value of \*(lqmasquerade:\*(rq line
-of
-.IR mts.conf .
-When that's turned on, setting the
-.B $USERNAME_EXTENSION
-environment variable will result in its value being appended the user's login
-name.  For instance, if I set
-.B $USERNAME_EXTENSION
-to \*(lq+www\*(rq, my \*(lqFrom:\*(rq
-line will contain \*(lqDan Harkless <dan+www@machine.company.com>\*(rq (or
-\*(lqDan.Harkless+www\*(rq if I'm using mmailid masquerading as well).  Recent versions
-of
-.B sendmail
-automatically deliver all mail sent to
-.IR user + string
-to
-.IR user .
-.B qmail
-has a similar feature which uses '\-' as the delimiter by
-default, but can use other characters as well.
+The mail transport system default is provided in
+.I %nmhetcdir%/mts.conf
+but can be overriiden here with the
+.B \-mts
+switch.
 .PP
-The fourth method of address masquerading is to specify a \*(lqFrom:\*(rq line manually
-in the message draft.  It will be used as provided (after alias substitution),
-but normally, to discourage email forgery, the user's
-.B real
-address will be
-used in the SMTP envelope \*(lqFrom:\*(rq and in a \*(lqSender:\*(rq header.  However, if the
-\*(lqmasquerade:\*(rq line of
-.I mts.conf
-contains \*(lqdraft_from\*(rq, the SMTP envelope \*(lqFrom:\*(rq
-will use the address given in the draft \*(lqFrom:\*(rq, and there will be no \*(lqSender:\*(rq
-header.  This is useful in pretending to send mail \*(lqdirectly\*(rq from a remote POP3
-account, or when remote email robots give improper precedence to the envelope
-\*(lqFrom:\*(rq.  Note that your MTA may still reveal your real identity (e.g.
-.BR sendmail 's
-\*(lqX\-Authentication\-Warning:\*(rq header). 
+If nmh is using as its mail transport system
+.BR sendmail/pipe ,
+the
+.B \-sendmail
+switch can be used to override the default
+.B sendmail
+program.
 .PP
 If nmh is using the SMTP MTA, the
 .B \-server
@@ -188,25 +205,30 @@ and the
 switches can be used to override the default mail server (defined by the
 .RI servers
 entry in
-.I %etcdir%/mts.conf
+.I %nmhetcdir%/mts.conf
 ).
 .PP
 If
 .B nmh
 has been compiled with SASL support, the
 .B \-sasl
-switch will enable
+and
+.B \-nosasl
+switches will enable and disable
 the use of SASL authentication with the SMTP MTA.  Depending on the
 SASL mechanism used, this may require an additional password prompt from the
 user (but the
-.RI \*(lq \&.netrc \*(rq
-file can be used to store this password).
+.I netrc
+file can be used to store this password, as described in the
+mh-profile(5) man page).  The
 .B \-saslmech
 switch can be used to select a particular SASL mechanism,
-and the the
+and the
 .B \-user
-switch can be used to select a authorization userid
-to provide to SASL other than the default.
+switch can be used to select a authorization userid to provide to SASL
+other than the default.  The credentials profile entry in the
+mh\-profile(5) man page describes the ways to supply a username and
+password.
 .PP
 If SASL authentication is successful, 
 .BR nmh
@@ -215,56 +237,88 @@ Encrypted data is labelled with `(sasl-encrypted)' and `(sasl-decrypted)' when
 viewing the SMTP transaction with the
 .B \-snoop
 switch.
+Base64-encoded data is wrapped with `b64<>'.
+(Beware that the SMTP transaction may contain authentication information either
+in plaintext or easily decoded base64.)
 .PP
 If
 .B nmh
 has been compiled with TLS support, the
 .B \-tls
-switch will require the negotiation of TLS support when connecting to the
-SMTP MTA.  Encrypted data is labelled with `(tls-encrypted)' and
+and
+.B \-initialtls
+switches will require the negotiation of TLS when
+connecting to the SMTP MTA.  The
+.B \-tls
+switch will negotiate TLS as part of the normal SMTP protocol
+using the STARTTLS command.  The
+.B \-initialtls
+will negotiate TLS immediately after the connection has
+taken place, before any SMTP commands are sent or received.  Encrypted data
+is labelled with `(tls-encrypted)' and
 `(tls-decrypted)' when viewing the SMTP transction with the
 .B \-snoop
 switch.
-
+Base64-encoded data is wrapped with `b64<>'.
+(Beware that the SMTP transaction may contain authentication information either
+in plaintext or easily decoded base64.)
+The
+.B \-notls
+switch will disable all attempts to negotiate TLS.
+.PP
+If port 465 is specified and none of the TLS switches were enabled,
+.B \-initialtls
+will be implied if TLS support was compiled in.  Though port 465 for
+SMTPS (SMTP over SSL) was deregistered by IANA in 1998, it is still
+used for that service.
+.PP
+.B post
+filters out header lines with names beginning with \*(lqNmh-\*(rq
+(case insensitive) from the message draft.
+Those lines are reserved for internal
+.B nmh
+use.
 .SH FILES
 .fc ^ ~
 .nf
-.ta \w'%etcdir%/ExtraBigFileName  'u
-^%etcdir%/mts.conf~^nmh mts configuration file
-^%etcdir%/MailAliases~^global nmh alias file
+.ta \w'%nmhetcdir%/ExtraBigFileName  'u
+^%nmhetcdir%/mts.conf~^nmh mts configuration file
+^%nmhetcdir%/MailAliases~^global nmh alias file
 ^%bindir%/refile~^Program to process Fcc:s
-^%libdir%/mhl~^Program to process Bcc:s
+^%nmhlibexecdir%/mhl~^Program to process Bcc:s
 .fi
-
 .SH "PROFILE COMPONENTS"
 .B post
 does
 .B NOT
 consult the user's
 .I \&.mh\(ruprofile
-
 .SH "SEE ALSO"
-mhmail(1), send(1), mh\-mail(5), mh\-alias(5), mh\-tailor(5),
+.IR mhmail (1),
+.IR send (1),
+.IR mh\-mail (5),
+.IR mh\-alias (5),
+.IR mh\-profile (5),
+.IR mh\-tailor (5)
+.PP
 .I "Standard for the Format of ARPA Internet Text Messages"
-(RFC\-822)
-
+(RFC 822)
 .SH DEFAULTS
 .nf
-.RB ` \-alias "' defaults to %etcdir%/MailAliases"
+.RB ` \-alias "' defaults to %nmhetcdir%/MailAliases"
 .RB ` \-format '
 .RB ` \-nomime '
 .RB ` \-nomsgid '
+.RB ` "\-messageid\ localname" '
 .RB ` \-noverbose '
 .RB ` \-nowatch '
 .RB ` "\-width\ 72" '
 .RB ` \-nofilter '
 .fi
-
 .SH CONTEXT
 None
-
 .SH BUGS
 \*(lqReply\-To:\*(rq fields are allowed to have groups in them according
-to the 822 specification, but
+to the RFC 822 specification, but
 .B post
 won't let you use them.