fix CNAME loop problem: gave error messages and requeued messages
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 8 Mar 1994 04:10:30 +0000 (20:10 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 8 Mar 1994 04:10:30 +0000 (20:10 -0800)
SCCS-vsn: usr.sbin/sendmail/src/domain.c 8.18
SCCS-vsn: usr.sbin/sendmail/src/err.c 8.25
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.77

usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/domain.c
usr/src/usr.sbin/sendmail/src/err.c

index e044ac2..cb3145a 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  8.76 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  8.77 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -1738,6 +1738,10 @@ giveresponse(stat, m, mci, ctladdr, e)
        if (LogLevel > ((stat == EX_TEMPFAIL) ? 8 : (stat == EX_OK) ? 7 : 6))
                logdelivery(m, mci, &statmsg[4], ctladdr, e);
 
        if (LogLevel > ((stat == EX_TEMPFAIL) ? 8 : (stat == EX_OK) ? 7 : 6))
                logdelivery(m, mci, &statmsg[4], ctladdr, e);
 
+       if (tTd(11, 2))
+               printf("giveresponse: stat=%d, e->e_message=%s\n",
+                       stat, e->e_message);
+
        if (stat != EX_TEMPFAIL)
                setstat(stat);
        if (stat != EX_OK && (stat != EX_TEMPFAIL || e->e_message == NULL))
        if (stat != EX_TEMPFAIL)
                setstat(stat);
        if (stat != EX_OK && (stat != EX_TEMPFAIL || e->e_message == NULL))
index 3537f7d..b5b1b14 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef NAMED_BIND
 
 #ifndef lint
 #ifdef NAMED_BIND
-static char sccsid[] = "@(#)domain.c   8.17 (Berkeley) %G% (with name server)";
+static char sccsid[] = "@(#)domain.c   8.18 (Berkeley) %G% (with name server)";
 #else
 #else
-static char sccsid[] = "@(#)domain.c   8.17 (Berkeley) %G% (without name server)";
+static char sccsid[] = "@(#)domain.c   8.18 (Berkeley) %G% (without name server)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -612,9 +612,19 @@ cnameloop:
                          case T_CNAME:
                                if (loopcnt++ > MAXCNAMEDEPTH)
                                {
                          case T_CNAME:
                                if (loopcnt++ > MAXCNAMEDEPTH)
                                {
-                                       syserr("DNS failure: CNAME loop for %s",
+                                       /*XXX should notify postmaster XXX*/
+                                       message("DNS failure: CNAME loop for %s",
                                                host);
                                                host);
-                                       continue;
+                                       if (CurEnv->e_message == NULL)
+                                       {
+                                               char ebuf[MAXLINE];
+
+                                               sprintf(ebuf, "Deferred: DNS failure: CNAME loop for %s",
+                                                       host);
+                                               CurEnv->e_message = newstr(ebuf);
+                                       }
+                                       h_errno = NO_RECOVERY;
+                                       return FALSE;
                                }
 
                                /* value points at name */
                                }
 
                                /* value points at name */
index ac265d7..02f7d94 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      8.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      8.25 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -88,6 +88,8 @@ syserr(fmt, va_alist)
                        ExitStat = EX_SOFTWARE;
                else
                        ExitStat = EX_OSERR;
                        ExitStat = EX_SOFTWARE;
                else
                        ExitStat = EX_OSERR;
+               if (tTd(54, 1))
+                       printf("syserr: ExitStat = %d\n", ExitStat);
        }
 
 # ifdef LOG
        }
 
 # ifdef LOG