]> diplodocus.org Git - nmh/blobdiff - uip/post.c
Doubled size of buffers used by m_getfld(), scan, and fmttest to
[nmh] / uip / post.c
index b940ac3a1a51adfde641c0b5b94285ca440bb2c8..16121359ee711178ea1bb08d50b55dafd199f129 100644 (file)
@@ -81,7 +81,7 @@
     X("saslmaxssf", SASLminc(-10), SASLMXSSFSW) \
     X("saslmech", SASLminc(-5), SASLMECHSW) \
     X("user", SASLminc(-4), USERSW) \
-    X("port server port name/number", 4, PORTSW) \
+    X("port server submission port name/number", 4, PORTSW) \
     X("tls", TLSminc(-3), TLSSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
     X("notls", TLSminc(-5), NTLSSW) \
@@ -200,8 +200,8 @@ static int sasl=0;          /* Use SASL auth for SMTP                */
 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="smtp";      /* Name of server port for SMTP          */
-static int tls=0;              /* Use TLS for encryption                */
+static char *port="submission";        /* Name of server port for SMTP submission */
+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?        */
 
@@ -602,6 +602,21 @@ main (int argc, char **argv)
        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. */