]> Pileus Git - ~andy/fetchmail/commitdiff
Don't generate MAIL FROM headers with embedded newlines.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 4 Jun 2001 08:07:53 +0000 (08:07 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 4 Jun 2001 08:07:53 +0000 (08:07 -0000)
svn path=/trunk/; revision=3334

driver.c

index 505bf26cc24723dade93246f9b321599fa5e9052..d05c8ef3e758a1771ee840a51ddcba0dd0c55091 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -922,7 +922,9 @@ static int readheaders(int sock,
        else if (from_offs >= 0 && (ap = nxtaddr(msgblk.headers + from_offs)));
        else if (reply_to_offs >= 0 && (ap = nxtaddr(msgblk.headers + reply_to_offs)));
        else if (app_from_offs >= 0 && (ap = nxtaddr(msgblk.headers + app_from_offs)));
-       if (ap) strcpy( msgblk.return_path, ap );
+       /* multi-line MAIL FROM addresses confuse SMTP terribly */
+       if (ap && !strchr(ap, '\n')) 
+           strcpy(msgblk.return_path, ap);
     }
 
     /* cons up a list of local recipients */