diff -ur sendmail-8.13.5-orig/libmilter/smfi.c sendmail-8.13.5-multiline/libmilter/smfi.c
--- sendmail-8.13.5-orig/libmilter/smfi.c	2005-03-29 19:44:07.000000000 -0500
+++ sendmail-8.13.5-multiline/libmilter/smfi.c	2005-10-30 11:07:53.000000000 -0500
@@ -378,7 +378,11 @@
 		size_t ml;
 
 		/* XXX check also for unprintable chars? */
+#if _FFR_MULTILINE_ERRORS
+		if (strpbrk(message, "\r") != NULL)
+#else /* _FFR_MULTILINE_ERRORS */
 		if (strpbrk(message, "\r\n") != NULL)
+#endif /* _FFR_MULTILINE_ERRORS */
 			return MI_FAILURE;
 		ml = strlen(message);
 		if (ml > MAXREPLYLEN)
diff -ur sendmail-8.13.5-orig/sendmail/conf.c sendmail-8.13.5-multiline/sendmail/conf.c
--- sendmail-8.13.5-orig/sendmail/conf.c	2005-07-26 01:45:38.000000000 -0400
+++ sendmail-8.13.5-multiline/sendmail/conf.c	2005-10-30 11:07:53.000000000 -0500
@@ -6062,6 +6062,10 @@
 	/* CRLPath; needs documentation; Al Smith */
 	"_FFR_CRLPATH",
 #endif /* _FFR_CRLPATH */
+#if _FFR_MULTILINE_ERRORS
+	/* Multiline error processing */
+	"_FFR_MULTILINE_ERRORS",
+#endif /* _FFR_MULTINELINE_ERRORS */
 #if _FFR_DAEMON_NETUNIX
 	/* Allow local (not just TCP) socket connection to server. */
 	"_FFR_DAEMON_NETUNIX",
diff -ur sendmail-8.13.5-orig/sendmail/conf.h sendmail-8.13.5-multiline/sendmail/conf.h
--- sendmail-8.13.5-orig/sendmail/conf.h	2005-08-31 17:34:20.000000000 -0400
+++ sendmail-8.13.5-multiline/sendmail/conf.h	2005-10-30 11:08:34.000000000 -0500
@@ -60,7 +60,7 @@
 **********************************************************************/
 
 #define MAXLINE		2048	/* max line length */
-#define MAXNAME		256	/* max length of a name */
+#define MAXNAME		256*10		/* max length of a name */
 #ifndef MAXAUTHINFO
 # define MAXAUTHINFO	100	/* max length of authinfo token */
 #endif /* ! MAXAUTHINFO */
diff -ur sendmail-8.13.5-orig/sendmail/err.c sendmail-8.13.5-multiline/sendmail/err.c
--- sendmail-8.13.5-orig/sendmail/err.c	2003-01-09 21:16:46.000000000 -0500
+++ sendmail-8.13.5-multiline/sendmail/err.c	2005-10-30 11:07:53.000000000 -0500
@@ -620,11 +620,73 @@
 	/* if DisConnected, OutChannel now points to the transcript */
 	if (!DisConnected &&
 	    (OpMode == MD_SMTP || OpMode == MD_DAEMON || OpMode == MD_ARPAFTP))
+#if _FFR_MULTILINE_ERRORS
+	{
+		register char * msg2;
+
+		if ((msg2 = strchr(msg, '\n')) &&
+		    !ISSMTPREPLY((msg2 + 1))) /* detect already multilined msg's */
+		{
+			char msgcode[16];
+			register char * msgbeg;
+			int errtxtoffset;
+			
+			errtxtoffset = ((int)(errtxt - msg) < sizeof msgcode - 2) ?
+				errtxt - msg : sizeof msgcode - 2;
+			msgbeg = msg + errtxtoffset;
+			if (errtxtoffset)
+			{
+				sm_strlcpy(msgcode, msg, errtxtoffset);
+				msgcode[errtxtoffset - 1] = msg[errtxtoffset - 1];
+			}
+			msgcode[errtxtoffset] = '\0';
+			
+			do
+			{
+				if (msg2 || (msg2 = strchr(msgbeg, '\n')))
+					*msg2 = '\0';
+				
+				if(!msg2 || !*(msg2+1))
+					msgcode[3] = msg[3];
+				else
+					msgcode[3] = '-';
+				
+				(void) sm_io_fprintf(OutChannel, SM_TIME_DEFAULT, "%s%s\r\n",
+					     msgcode, msgbeg);
+				if (msg2)
+				{
+					*msg2 = ' '; 
+					msgbeg = msg2 + 1;
+					msg2 = NULL; /* needed */
+				}
+				else
+					break;
+					
+			} while (msgbeg && *msgbeg);
+		}
+		else
+			(void) sm_io_fprintf(OutChannel, SM_TIME_DEFAULT, "%s\r\n",
+					     msg);
+	}
+	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.5-orig/sendmail/parseaddr.c sendmail-8.13.5-multiline/sendmail/parseaddr.c
--- sendmail-8.13.5-orig/sendmail/parseaddr.c	2005-02-04 17:01:45.000000000 -0500
+++ sendmail-8.13.5-multiline/sendmail/parseaddr.c	2005-10-30 11:07:53.000000000 -0500
@@ -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.5-orig/sendmail/sendmail.h sendmail-8.13.5-multiline/sendmail/sendmail.h
--- sendmail-8.13.5-orig/sendmail/sendmail.h	2005-06-23 19:11:22.000000000 -0400
+++ sendmail-8.13.5-multiline/sendmail/sendmail.h	2005-10-30 11:07:53.000000000 -0500
@@ -2453,6 +2453,9 @@
 extern time_t	curtime __P((void));
 extern char	*defcharset __P((ENVELOPE *));
 extern char	*denlstring __P((char *, bool, bool));
+#if _FFR_MULTILINE_ERRORS
+extern void	convnlstring __P((char *));
+#endif /* _FFR_MULTILINE_ERRORS */
 extern void	dferror __P((SM_FILE_T *volatile, char *, ENVELOPE *));
 extern void	disconnect __P((int, ENVELOPE *));
 #if _FFR_CONTROL_MSTAT
diff -ur sendmail-8.13.5-orig/sendmail/util.c sendmail-8.13.5-multiline/sendmail/util.c
--- sendmail-8.13.5-orig/sendmail/util.c	2004-08-02 14:50:59.000000000 -0400
+++ sendmail-8.13.5-multiline/sendmail/util.c	2005-10-30 11:07:53.000000000 -0500
@@ -2325,6 +2325,57 @@
 	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;
+	register int in_esc = false;
+
+	if (s == NULL)
+		return;
+
+	p = q = s;
+	do
+	{
+		c = *p++;
+		if (c == '\\' && !in_esc)
+		{
+			if ( *p == 'n')
+			{
+				c = '\n';
+				p++;
+			}
+			else if (*p == '\\')
+			{
+				in_esc = true;
+			}
+		}
+		else
+			in_esc = false;
+			
+		*q++ = c;
+	} while (c != '\0');
+}
+#endif /* _FFR_MULTILINE_ERRORS */
+
 /*
 **  STRREPLNONPRT -- replace "unprintable" characters in a string with subst
 **
