improved debugging
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 28 Nov 1994 03:20:18 +0000 (19:20 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 28 Nov 1994 03:20:18 +0000 (19:20 -0800)
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.115
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.50
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.45
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.71

usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/readcf.c

index eeb6d58..6bc9a89 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  8.114 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  8.115 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -812,6 +812,12 @@ deliver(e, firstto)
                if (bitnset(M_RUNASRCPT, to->q_mailer->m_flags))
                        ctladdr = getctladdr(to);
 
                if (bitnset(M_RUNASRCPT, to->q_mailer->m_flags))
                        ctladdr = getctladdr(to);
 
+               if (tTd(10, 2))
+               {
+                       printf("ctladdr=");
+                       printaddr(ctladdr, FALSE);
+               }
+
                user = to->q_user;
                e->e_to = to->q_paddr;
                if (tTd(10, 5))
                user = to->q_user;
                e->e_to = to->q_paddr;
                if (tTd(10, 5))
index e3e9cca..f312f4c 100644 (file)
@@ -13,7 +13,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     8.70 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     8.71 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -838,33 +838,7 @@ main(argc, argv, envp)
 
                        if (m == NULL)
                                continue;
 
                        if (m == NULL)
                                continue;
-                       printf("mailer %d (%s): P=%s S=%d/%d R=%d/%d M=%ld U=%d:%d F=",
-                               i, m->m_name,
-                               m->m_mailer, m->m_se_rwset, m->m_sh_rwset,
-                               m->m_re_rwset, m->m_rh_rwset, m->m_maxsize,
-                               m->m_uid, m->m_gid);
-                       for (j = '\0'; j <= '\177'; j++)
-                               if (bitnset(j, m->m_flags))
-                                       (void) putchar(j);
-                       printf("L=%d E=", m->m_linelimit);
-                       xputs(m->m_eol);
-                       if (m->m_defcharset != NULL)
-                               printf(" C=%s", m->m_defcharset);
-                       if (m->m_mtstype != NULL)
-                               printf(" T=%s", m->m_mtstype);
-                       if (m->m_argv != NULL)
-                       {
-                               char **a = m->m_argv;
-
-                               printf(" A=");
-                               while (*a != NULL)
-                               {
-                                       if (a != m->m_argv)
-                                               printf(" ");
-                                       xputs(*a++);
-                               }
-                       }
-                       printf("\n");
+                       printmailer(m);
                }
        }
 
                }
        }
 
index 9ef19f9..8a0e9fb 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parseaddr.c        8.44 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c        8.45 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -1895,21 +1895,56 @@ sameaddr(a, b)
 **             none.
 */
 
 **             none.
 */
 
+struct qflags
+{
+       char    *qf_name;
+       u_long  qf_bit;
+};
+
+struct qflags  AddressFlags[] =
+{
+       "QDONTSEND",            QDONTSEND,
+       "QBADADDR",             QBADADDR,
+       "QGOODUID",             QGOODUID,
+       "QPRIMARY",             QPRIMARY,
+       "QQUEUEUP",             QQUEUEUP,
+       "QSENT",                QSENT,
+       "QNOTREMOTE",           QNOTREMOTE,
+       "QSELFREF",             QSELFREF,
+       "QVERIFIED",            QVERIFIED,
+       "QREPORT",              QREPORT,
+       "QBOGUSSHELL",          QBOGUSSHELL,
+       "QUNSAFEADDR",          QUNSAFEADDR,
+       "QPINGONSUCCESS",       QPINGONSUCCESS,
+       "QPINGONFAILURE",       QPINGONFAILURE,
+       "QPINGONDELAY",         QPINGONDELAY,
+       "QHAS_RET_PARAM",       QHAS_RET_PARAM,
+       "QRET_HDRS",            QRET_HDRS,
+       "QRELAYED",             QRELAYED,
+       NULL
+};
+
 void
 printaddr(a, follow)
        register ADDRESS *a;
        bool follow;
 {
 void
 printaddr(a, follow)
        register ADDRESS *a;
        bool follow;
 {
-       bool first = TRUE;
        register MAILER *m;
        MAILER pseudomailer;
        register MAILER *m;
        MAILER pseudomailer;
+       register struct qflags *qfp;
+       bool firstone;
+
+       if (a == NULL)
+       {
+               printf("[NULL]\n");
+               return;
+       }
 
        static int indent;
        register int i;
 
        while (a != NULL)
        {
 
        static int indent;
        register int i;
 
        while (a != NULL)
        {
-               first = FALSE;
                for (i = indent; i > 0; i--)
                        printf("\t");
                printf("%x=", a);
                for (i = indent; i > 0; i--)
                        printf("\t");
                printf("%x=", a);
@@ -1939,8 +1974,6 @@ printaddr(a, follow)
                indent--;
                a = a->q_sibling;
        }
                indent--;
                a = a->q_sibling;
        }
-       if (first)
-               printf("[NULL]\n");
 }
 \f/*
 **  EMPTYADDR -- return TRUE if this address is empty (``<>'')
 }
 \f/*
 **  EMPTYADDR -- return TRUE if this address is empty (``<>'')
index bcc3479..b8db584 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)readcf.c   8.49 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c   8.50 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -1055,7 +1055,49 @@ printrules()
                }
        }
 }
                }
        }
 }
+\f/*
+**  PRINTMAILER -- print mailer structure (for debugging)
+**
+**     Parameters:
+**             m -- the mailer to print
+**
+**     Returns:
+**             none.
+*/
 
 
+printmailer(m)
+       register MAILER *m;
+{
+       int j;
+
+       printf("mailer %d (%s): P=%s S=%d/%d R=%d/%d M=%ld U=%d:%d F=",
+               m->m_mno, m->m_name,
+               m->m_mailer, m->m_se_rwset, m->m_sh_rwset,
+               m->m_re_rwset, m->m_rh_rwset, m->m_maxsize,
+               m->m_uid, m->m_gid);
+       for (j = '\0'; j <= '\177'; j++)
+               if (bitnset(j, m->m_flags))
+                       (void) putchar(j);
+       printf(" L=%d E=", m->m_linelimit);
+       xputs(m->m_eol);
+       if (m->m_defcharset != NULL)
+               printf(" C=%s", m->m_defcharset);
+       if (m->m_mtstype != NULL)
+               printf(" T=%s", m->m_mtstype);
+       if (m->m_argv != NULL)
+       {
+               char **a = m->m_argv;
+
+               printf(" A=");
+               while (*a != NULL)
+               {
+                       if (a != m->m_argv)
+                               printf(" ");
+                       xputs(*a++);
+               }
+       }
+       printf("\n");
+}
 \f/*
 **  SETOPTION -- set global processing option
 **
 \f/*
 **  SETOPTION -- set global processing option
 **