From bdd1eb9ab45706ebb061658f124190ff939d62a5 Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Sun, 27 Nov 1994 19:20:18 -0800 Subject: [PATCH] improved debugging 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 | 8 ++++- usr/src/usr.sbin/sendmail/src/main.c | 30 ++-------------- usr/src/usr.sbin/sendmail/src/parseaddr.c | 43 +++++++++++++++++++--- usr/src/usr.sbin/sendmail/src/readcf.c | 44 ++++++++++++++++++++++- 4 files changed, 90 insertions(+), 35 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/deliver.c b/usr/src/usr.sbin/sendmail/src/deliver.c index eeb6d58562..6bc9a89849 100644 --- a/usr/src/usr.sbin/sendmail/src/deliver.c +++ b/usr/src/usr.sbin/sendmail/src/deliver.c @@ -7,7 +7,7 @@ */ #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" @@ -812,6 +812,12 @@ deliver(e, firstto) 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)) diff --git a/usr/src/usr.sbin/sendmail/src/main.c b/usr/src/usr.sbin/sendmail/src/main.c index e3e9cca684..f312f4c73b 100644 --- a/usr/src/usr.sbin/sendmail/src/main.c +++ b/usr/src/usr.sbin/sendmail/src/main.c @@ -13,7 +13,7 @@ static char copyright[] = #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 @@ -838,33 +838,7 @@ main(argc, argv, envp) 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); } } diff --git a/usr/src/usr.sbin/sendmail/src/parseaddr.c b/usr/src/usr.sbin/sendmail/src/parseaddr.c index 9ef19f9318..8a0e9fb6a0 100644 --- a/usr/src/usr.sbin/sendmail/src/parseaddr.c +++ b/usr/src/usr.sbin/sendmail/src/parseaddr.c @@ -7,7 +7,7 @@ */ #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" @@ -1895,21 +1895,56 @@ sameaddr(a, b) ** 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; { - bool first = TRUE; 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) { - first = FALSE; for (i = indent; i > 0; i--) printf("\t"); printf("%x=", a); @@ -1939,8 +1974,6 @@ printaddr(a, follow) indent--; a = a->q_sibling; } - if (first) - printf("[NULL]\n"); } /* ** EMPTYADDR -- return TRUE if this address is empty (``<>'') diff --git a/usr/src/usr.sbin/sendmail/src/readcf.c b/usr/src/usr.sbin/sendmail/src/readcf.c index bcc34793db..b8db5849cf 100644 --- a/usr/src/usr.sbin/sendmail/src/readcf.c +++ b/usr/src/usr.sbin/sendmail/src/readcf.c @@ -7,7 +7,7 @@ */ #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" @@ -1055,7 +1055,49 @@ printrules() } } } + /* +** 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"); +} /* ** SETOPTION -- set global processing option ** -- 2.20.1