]> diplodocus.org Git - nmh/blobdiff - mts/smtp/smtp.c
picksbr.c: fprintf function pointer with unsigned-long-long cast.
[nmh] / mts / smtp / smtp.c
index c8bea5b86fbb792514474264bcd12cab505900aa..7808e1a70871454de78e9e306e4ad147f7383bdd 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * smtp.c -- nmh SMTP interface
+/* smtp.c -- nmh SMTP interface
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * RP_-style codes.
  */
 
  * RP_-style codes.
  */
 
-/*
- * On older 4.2BSD machines without the POSIX function `sigaction',
- * the alarm handing stuff for time-outs will NOT work due to the way
- * syscalls get restarted.  This is not really crucial, since SendMail
- * is generally well-behaved in this area.
- */
-
-#ifdef SENDMAILBUG
-/*
- * It appears that some versions of Sendmail will return Code 451
- * when they don't really want to indicate a failure.
- * "Code 451 almost always means sendmail has deferred; we don't
- * really want bomb out at this point since sendmail will rectify
- * things later."  So, if you define SENDMAILBUG, Code 451 is
- * considered the same as Code 250.  Yuck!
- */
-#endif
-
 #define        NBITS ((sizeof (int)) * 8)
 
 #define        NBITS ((sizeof (int)) * 8)
 
-/*
- * these codes must all be different!
- */
+/* Timeout in seconds for SMTP commands.
+ * Lore has it they must be distinct. */
 #define        SM_OPEN  300      /* Changed to 5 minutes to comply with a SHOULD in RFC 1123 */
 #define        SM_HELO  20
 #define        SM_RSET  15
 #define        SM_MAIL  301      /* changed to 5 minutes and a second (for uniqueness), see above */
 #define        SM_RCPT  302      /* see above */
 #define        SM_DATA  120      /* see above */
 #define        SM_OPEN  300      /* Changed to 5 minutes to comply with a SHOULD in RFC 1123 */
 #define        SM_HELO  20
 #define        SM_RSET  15
 #define        SM_MAIL  301      /* changed to 5 minutes and a second (for uniqueness), see above */
 #define        SM_RCPT  302      /* see above */
 #define        SM_DATA  120      /* see above */
-#define        SM_TEXT 180     /* see above */
 #define        SM_DOT  600     /* see above */
 #define        SM_QUIT  30
 #define        SM_DOT  600     /* see above */
 #define        SM_QUIT  30
-#define        SM_CLOS  10
-#define        SM_AUTH  45
 
 static int sm_addrs = 0;
 static int sm_child = NOTOK;
 
 static int sm_addrs = 0;
 static int sm_child = NOTOK;
@@ -498,17 +475,13 @@ sm_wadr (char *mbox, char *host, char *path)
 {
     switch (smtalk (SM_RCPT, host && *host ? "RCPT TO:<%s%s@%s>"
                                           : "RCPT TO:<%s%s>",
 {
     switch (smtalk (SM_RCPT, host && *host ? "RCPT TO:<%s%s@%s>"
                                           : "RCPT TO:<%s%s>",
-                            path ? path : "", mbox, host)) {
+                            FENDNULL(path), mbox, host)) {
        case 250: 
        case 251: 
            sm_addrs++;
            return RP_OK;
 
        case 451: 
        case 250: 
        case 251: 
            sm_addrs++;
            return RP_OK;
 
        case 451: 
-#ifdef SENDMAILBUG
-           sm_addrs++;
-           return RP_OK;
-#endif /* SENDMAILBUG */
        case 421: 
        case 450: 
        case 452: 
        case 421: 
        case 450: 
        case 452: 
@@ -539,10 +512,6 @@ sm_waend (void)
            return RP_OK;
 
        case 451: 
            return RP_OK;
 
        case 451: 
-#ifdef SENDMAILBUG
-           sm_nl = TRUE;
-           return RP_OK;
-#endif /* SENDMAILBUG */
        case 421: 
            return RP_NO;
 
        case 421: 
            return RP_NO;
 
@@ -581,9 +550,6 @@ sm_wtend (void)
            return RP_OK;
 
        case 451: 
            return RP_OK;
 
        case 451: 
-#ifdef SENDMAILBUG
-           return RP_OK;
-#endif /* SENDMAILBUG */
        case 452: 
        default: 
            return RP_NO;
        case 452: 
        default: 
            return RP_NO;
@@ -654,7 +620,7 @@ sm_end (int type)
     }
 
     if (nsc != NULL) {
     }
 
     if (nsc != NULL) {
-       netsec_shutdown(nsc, 1);
+       netsec_shutdown(nsc);
        nsc = NULL;
     }
 
        nsc = NULL;
     }
 
@@ -904,7 +870,8 @@ char *
 rp_string (int code)
 {
     char *text;
 rp_string (int code)
 {
     char *text;
-    static char buffer[BUFSIZ];
+    /* The additional space is to avoid warning from gcc -Wformat-truncation. */
+    static char buffer[BUFSIZ + 19];
 
     switch (sm_reply.code != NOTOK ? code : NOTOK) {
        case RP_AOK:
 
     switch (sm_reply.code != NOTOK ? code : NOTOK) {
        case RP_AOK: