]> diplodocus.org Git - nmh/commitdiff
If the user didn't specify any of the tls switches to post(8), try to
authorDavid Levine <levinedl@acm.org>
Wed, 9 Jul 2014 00:58:12 +0000 (19:58 -0500)
committerDavid Levine <levinedl@acm.org>
Wed, 9 Jul 2014 00:58:12 +0000 (19:58 -0500)
help them by implying -initialtls if they're using port 465 (smtps,
until IANA revoked that registration in 1998).

man/post.man
man/send.man
uip/post.c

index 8ea92332f13482b6f665386bc2de725bbbd55de6..a1fb31601c8e360f6f205a47ceedcb4267950db0 100644 (file)
@@ -1,4 +1,4 @@
-.TH POST %manext8% "April 14, 2013" "%nmhversion%"
+.TH POST %manext8% "July 8, 2014" "%nmhversion%"
 .\"
 .\" %nmhwarning%
 .\"
 .\"
 .\" %nmhwarning%
 .\"
@@ -249,6 +249,12 @@ switch.
 The
 .B \-notls
 switch will disable all attempts to negotiate TLS.
 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.
 .SH FILES
 .fc ^ ~
 .nf
 .SH FILES
 .fc ^ ~
 .nf
index c8346c345cf73ca9f91359cd8ec0de3b062d802c..6e22bba280531edfb76270d299aac9c1d835c5f3 100644 (file)
@@ -1,7 +1,7 @@
 .\"
 .\" %nmhwarning%
 .\"
 .\"
 .\" %nmhwarning%
 .\"
-.TH SEND %manext1% "January 23, 2014" "%nmhversion%"
+.TH SEND %manext1% "July 8, 2014" "%nmhversion%"
 .SH NAME
 send \- send a message
 .SH SYNOPSIS
 .SH NAME
 send \- send a message
 .SH SYNOPSIS
@@ -436,6 +436,12 @@ The
 .B \-notls
 switch will disable all attempts to negotiate TLS.
 .PP
 .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
 The files specified by the profile entry \*(lqAliasfile:\*(rq and any
 additional alias files given by the
 .B \-alias
 The files specified by the profile entry \*(lqAliasfile:\*(rq and any
 additional alias files given by the
 .B \-alias
index ef9c88032b50de1cba18571346edafdb9ae8b8e4..16121359ee711178ea1bb08d50b55dafd199f129 100644 (file)
@@ -201,7 +201,7 @@ static int saslssf=-1;              /* Our maximum SSF for SASL              */
 static char *saslmech=NULL;    /* Force use of particular SASL mech     */
 static char *user=NULL;                /* Authenticate as this user             */
 static char *port="submission";        /* Name of server port for SMTP submission */
 static char *saslmech=NULL;    /* Force use of particular SASL mech     */
 static char *user=NULL;                /* Authenticate as this user             */
 static char *port="submission";        /* Name of server port for SMTP submission */
-static int tls=0;              /* Use TLS for encryption                */
+static int tls=-1;             /* Use TLS for encryption                */
 static int fromcount=0;                /* Count of addresses on From: header    */
 static int seensender=0;       /* Have we seen a Sender: header?        */
 
 static int fromcount=0;                /* Count of addresses on From: header    */
 static int seensender=0;       /* Have we seen a Sender: header?        */
 
@@ -602,6 +602,21 @@ main (int argc, char **argv)
        envelope = from;
     }
 
        envelope = from;
     }
 
+    if (tls == -1) {
+#ifdef TLS_SUPPORT
+       /*
+        * The user didn't specify any of the tls switches.  Try to
+        * help them by implying -initialtls if they're using port 465
+        * (smtps, until IANA revoked that registration in 1998).
+        */
+       tls = ! strcmp (port, "465")  ||  ! strcasecmp (port, "smtps")
+           ?  2
+           :  0;
+#else  /* ! TLS_SUPPORT */
+       tls = 0;
+#endif /* ! TLS_SUPPORT */
+    }
+
     /* If we are doing a "whom" check */
     if (whomsw) {
        /* This won't work with MTS_SENDMAIL_PIPE. */
     /* If we are doing a "whom" check */
     if (whomsw) {
        /* This won't work with MTS_SENDMAIL_PIPE. */