]> diplodocus.org Git - nmh/blobdiff - mts/smtp/smtp.c
Alter HasSuffixC()'s char * to be const.
[nmh] / mts / smtp / smtp.c
index c94ac31308063d2de637c531b857779b5051bae3..68228ee3daaf7f5c68f38d59838d756e7a173a98 100644 (file)
@@ -40,9 +40,6 @@
  */
 #endif
 
  */
 #endif
 
-#define        TRUE    1
-#define        FALSE   0
-
 #define        NBITS ((sizeof (int)) * 8)
 
 /*
 #define        NBITS ((sizeof (int)) * 8)
 
 /*
@@ -103,9 +100,9 @@ sm_init (char *client, char *server, char *port, int watch, int verbose,
     if (sm_mts == MTS_SMTP)
        return smtp_init (client, server, port, watch, verbose,
                          debug, sasl, saslmech, user, oauth_svc, tls);
     if (sm_mts == MTS_SMTP)
        return smtp_init (client, server, port, watch, verbose,
                          debug, sasl, saslmech, user, oauth_svc, tls);
-    else
-       return sendmail_init (client, watch, verbose, debug, sasl,
-                             saslmech, user);
+
+    return sendmail_init (client, watch, verbose, debug, sasl,
+                          saslmech, user);
 }
 
 static int
 }
 
 static int
@@ -131,14 +128,13 @@ smtp_init (char *client, char *server, char *port, int watch, int verbose,
        } else {
            client = LocalName(1);      /* no clientname -> LocalName */
        }
        } else {
            client = LocalName(1);      /* no clientname -> LocalName */
        }
-    }
-
-    /*
-     * Last-ditch check just in case client still isn't set to anything
-     */
 
 
-    if (client == NULL || *client == '\0')
-       client = "localhost";
+        /*
+         * Last-ditch check just in case client still isn't set to anything
+         */
+        if (client == NULL || *client == '\0')
+            client = "localhost";
+    }
 
     nsc = netsec_init();
 
 
     nsc = netsec_init();
 
@@ -299,14 +295,13 @@ sendmail_init (char *client, int watch, int verbose, int debug, int sasl,
            client = clientname;
        else
            client = LocalName(1);      /* no clientname -> LocalName */
            client = clientname;
        else
            client = LocalName(1);      /* no clientname -> LocalName */
-    }
-
-    /*
-     * Last-ditch check just in case client still isn't set to anything
-     */
 
 
-    if (client == NULL || *client == '\0')
-       client = "localhost";
+        /*
+         * Last-ditch check just in case client still isn't set to anything
+         */
+        if (client == NULL || *client == '\0')
+            client = "localhost";
+    }
 
     nsc = netsec_init();
 
 
     nsc = netsec_init();
 
@@ -453,6 +448,9 @@ sm_winit (char *from, int smtputf8, int eightbit)
         if (EHLOset ("8BITMIME")  &&  EHLOset ("SMTPUTF8")) {
             mail_parameters = " BODY=8BITMIME SMTPUTF8";
         } else {
         if (EHLOset ("8BITMIME")  &&  EHLOset ("SMTPUTF8")) {
             mail_parameters = " BODY=8BITMIME SMTPUTF8";
         } else {
+            advise (NULL, "SMTP server does not support %s, not sending.\n"
+                    "Rebuild message with 7-bit headers, WITHOUT -headerencoding utf-8.",
+                    EHLOset ("SMTPUTF8") ? "8BITMIME" : "SMTPUTF8");
             sm_end (NOTOK);
             return RP_UCMD;
         }
             sm_end (NOTOK);
             return RP_UCMD;
         }
@@ -464,7 +462,7 @@ sm_winit (char *from, int smtputf8, int eightbit)
         } else {
             advise (NULL, "SMTP server does not support 8BITMIME, not sending.\n"
                     "Suggest encoding message for 7-bit transport by setting your\n"
         } else {
             advise (NULL, "SMTP server does not support 8BITMIME, not sending.\n"
                     "Suggest encoding message for 7-bit transport by setting your\n"
-                    "locale to C, and/or specifying *b64 in mhbuild directives.\n");
+                    "locale to C, and/or specifying *b64 in mhbuild directives.");
             sm_end (NOTOK);
             return RP_UCMD;
         }
             sm_end (NOTOK);
             return RP_UCMD;
         }
@@ -813,7 +811,7 @@ again: ;
                                                 &errstr)) != NULL ; ) {
 
        if (doingEHLO
                                                 &errstr)) != NULL ; ) {
 
        if (doingEHLO
-               && strncmp (buffer, "250", sizeof("250") - 1) == 0
+               && strncmp (buffer, "250", LEN("250")) == 0
                && (buffer[3] == '-' || doingEHLO == 2)
                && buffer[4]) {
            if (doingEHLO == 2) {
                && (buffer[3] == '-' || doingEHLO == 2)
                && buffer[4]) {
            if (doingEHLO == 2) {