Article View: comp.mail.sendmail
Article #3198Re: debugging output
From: Larry Parmelee
Date: Thu, 16 Feb 1989 14:44
Date: Thu, 16 Feb 1989 14:44
89 lines
2888 bytes
2888 bytes
Refering to the debugging output of sendmail,
In article <10539@ut-emx.UUCP> reeder@ut-emx.UUCP (William P. Reeder) writes:
> Now I know that sendmail configuration files are cryptic, but don't you
> think "^P" "<@" "^Q" ">" is even worse? Why isn't there a special
> routine which prints rules reasonably? (For the sake of consistancy I
> will accept sendmail.cf style rules as reasonable.)
Someone (not me, and I don't remember who) did it a while back. I
thought it was a useful hack, so I saved it. Here it is as applied
to sendmail 5.61.
-Larry Parmelee
parmelee@cs.cornell.edu
*** /tmp/,RCSt1001981 Thu Feb 16 09:38:07 1989
--- util.c Tue Jan 31 14:43:28 1989
***************
*** 280,289 ****
--- 280,349 ----
}
if (c < 040 || c >= 0177)
{
+ #ifdef ORIGINAL
(void) putchar('^');
c ^= 0100;
}
(void) putchar(c);
+ #else /* !ORIGINAL */
+ char *cp;
+
+ switch (c) {
+ case MATCHZANY: /* match zero or more tokens */
+ cp = "$*";
+ break;
+ case MATCHANY: /* match one or more tokens */
+ cp = "$+";
+ break;
+ case MATCHONE: /* match exactly one token */
+ cp = "$-";
+ break;
+ case MATCHCLASS:/* match one token in a class */
+ cp = "$=";
+ break;
+ case MATCHNCLASS:/* match anything not in class */
+ cp = "$~";
+ break;
+ case MATCHREPL: /* replacement on RHS for above */
+ cp = "$";
+ break;
+ case CANONNET: /* canonical net, next token */
+ cp = "$#";
+ break;
+ case CANONHOST: /* canonical host, next token */
+ cp = "$@";
+ break;
+ case CANONUSER: /* canonical user, next N tokens */
+ cp = "$:";
+ break;
+ case CALLSUBR: /* call another rewriting set */
+ cp = "$>";
+ break;
+ case CONDIF: /* conditional if-then */
+ cp = "$?";
+ break;
+ case CONDELSE: /* conditional else */
+ cp = "$|";
+ break;
+ case CONDFI: /* conditional fi */
+ cp = "$.";
+ break;
+ case HOSTBEGIN: /* hostname lookup begin */
+ cp = "$[";
+ break;
+ case HOSTEND: /* hostname lookup end */
+ cp = "$]";
+ break;
+ default:
+ cp = "^ ";
+ cp[1] = c ^ 0100;
+ break;
+ }
+ fputs(cp, stdout);
+ } else
+ (void) putchar(c);
+
+ #endif /* ORIGINAL */
}
(void) putchar('"');
(void) fflush(stdout);
Technical Details
Message-ID:
<25193@cornell.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!parmeleeReferences:
<10539@ut-emx.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!parmelee From: parmelee@wayback.cs.cornell.edu (Larry Parmelee) Newsgroups: comp.mail.sendmail Subject: Re: debugging output Keywords: printav(), xputs() Message-ID: <25193@cornell.UUCP> Date: 16 Feb 89 14:44:37 GMT References: <10539@ut-emx.UUCP> Sender: nobody@cornell.UUCP Reply-To: parmelee@wayback.cs.cornell.edu (Larry Parmelee) Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 89