diff -ur sendmail-8.13.1-orig/sendmail/err.c sendmail-8.13.1-multiline/sendmail/err.c --- sendmail-8.13.1-orig/sendmail/err.c 2003-01-09 21:16:46.000000000 -0500 +++ sendmail-8.13.1-multiline/sendmail/err.c 2004-10-26 07:46:09.000000000 -0400 @@ -620,11 +620,55 @@ /* if DisConnected, OutChannel now points to the transcript */ if (!DisConnected && (OpMode == MD_SMTP || OpMode == MD_DAEMON || OpMode == MD_ARPAFTP)) +#if _FFR_MULTILINE_ERRORS + { + char msgcode[5]; + char * msgbeg = msg + 4; + char * msg2 = NULL; + ssize_t msgsize = strlen(msgbeg); + + sm_strlcpy(msgcode, msg, sizeof(msgcode)); + do + { + if ((msg2 = memchr((void*)msgbeg, '\n', msgsize))) + { + *msg2 = '\0'; + msgsize -= (msg2 - msgbeg); + msgcode[3] = '-'; + } + else + msgcode[3] = msg[3]; + + (void) sm_io_fprintf(OutChannel, SM_TIME_DEFAULT, "%s%s\r\n", + msgcode, msgbeg); + if (msg2) + { + *msg2 = ' '; + msg2++; + } + + } while ((msgbeg = msg2) && (*msg2) && msgsize); + } + else + { + register int i = 0; + while (msg[i]) + { + if(msg[i] == '\n') + msg[i] = ' '; + i++; + + } + (void) sm_io_fprintf(OutChannel, SM_TIME_DEFAULT, "%s\n", + errtxt); + } +#else (void) sm_io_fprintf(OutChannel, SM_TIME_DEFAULT, "%s\r\n", msg); else (void) sm_io_fprintf(OutChannel, SM_TIME_DEFAULT, "%s\n", errtxt); +#endif /* _FFR_MULTILINE_ERRORS */ if (TrafficLogFile != NULL) (void) sm_io_fprintf(TrafficLogFile, SM_TIME_DEFAULT, "%05d >>> %s\n", (int) CurrentPid, diff -ur sendmail-8.13.1-orig/sendmail/parseaddr.c sendmail-8.13.1-multiline/sendmail/parseaddr.c --- sendmail-8.13.1-orig/sendmail/parseaddr.c 2004-05-18 16:01:54.000000000 -0400 +++ sendmail-8.13.1-multiline/sendmail/parseaddr.c 2004-10-26 07:41:31.000000000 -0400 @@ -2007,7 +2007,11 @@ a->q_host = NULL; setstat(EX_UNAVAILABLE); } +#if _FFR_MULTILINE_ERRORS + convnlstring(ubuf); +#endif /* _FFR_MULTILINE_ERRORS */ stripquotes(ubuf); + if (ISSMTPCODE(ubuf) && ubuf[3] == ' ') { char fmt[16]; diff -ur sendmail-8.13.1-orig/sendmail/util.c sendmail-8.13.1-multiline/sendmail/util.c --- sendmail-8.13.1-orig/sendmail/util.c 2004-03-26 14:01:10.000000000 -0500 +++ sendmail-8.13.1-multiline/sendmail/util.c 2004-10-26 07:41:31.000000000 -0400 @@ -2324,6 +2324,46 @@ return bp; } +#if _FFR_MULTILINE_ERRORS +/* +** CONVNLSTRING -- Convert "\n" in string to '\n'. This is done in place. +** +** Parameters: +** s -- string +** +** Returns: +** +** nothing +** +** Side effects: +** s now contains unquoted newline charachters +** +*/ +void +convnlstring(s) + char *s; +{ + register char *p; + register char *q; + register char c; + + if (s == NULL) + return; + + p = q = s; + do + { + c = *p++; + if (c == '\\' && *p == 'n') + { + c = '\n'; + p++; + } + *q++ = c; + } while (c != '\0'); +} +#endif /* _FFR_MULTILINE_ERRORS */ + /* ** STRREPLNONPRT -- replace "unprintable" characters in a string with subst **