From c306c8b3aef546e0584b8625176058956becc675 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 3 Oct 1996 07:48:30 +0000 Subject: Avoid croaking on all-lower-case headers. svn path=/trunk/; revision=207 --- driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/driver.c b/driver.c index 7ff063b2..cd6712a2 100644 --- a/driver.c +++ b/driver.c @@ -357,13 +357,13 @@ int rewrite; if (!strncmp(bufp,"From ",5)) unixfrom = bufp; - else if (!strncmp("From: ", bufp, 6)) + else if (!strncasecmp("From: ", bufp, 6)) fromhdr = bufp; - else if (!strncmp("To: ", bufp, 4)) + else if (!strncasecmp("To: ", bufp, 4)) tohdr = bufp; - else if (!strncmp("Cc: ", bufp, 4)) + else if (!strncasecmp("Cc: ", bufp, 4)) cchdr = bufp; - else if (!strncmp("Bcc: ", bufp, 5)) + else if (!strncasecmp("Bcc: ", bufp, 5)) bcchdr = bufp; goto skipwrite; @@ -380,19 +380,19 @@ int rewrite; * a la sendmail -- crack all the destination headers * and send to every address we can reach via SMTP. */ - if ((cp = nxtaddr(tohdr)) != (char *)NULL) + if (tohdr && (cp = nxtaddr(tohdr)) != (char *)NULL) do { if (SMTP_rcpt(mboxfd, cp) == SM_UNRECOVERABLE) return(PS_SMTP); } while (cp = nxtaddr(NULL)); - if ((cp = nxtaddr(cchdr)) != (char *)NULL) + if (cchdr && (cp = nxtaddr(cchdr)) != (char *)NULL) do { if (SMTP_rcpt(mboxfd, cp) == SM_UNRECOVERABLE) return(PS_SMTP); } while (cp = nxtaddr(NULL)); - if ((cp = nxtaddr(bcchdr)) != (char *)NULL) + if (bcchdr && (cp = nxtaddr(bcchdr)) != (char *)NULL) do { if (SMTP_rcpt(mboxfd, cp) == SM_UNRECOVERABLE) return(PS_SMTP); -- cgit v1.2.3