From: Eric Allman Date: Tue, 12 Apr 1994 23:21:15 +0000 (-0800) Subject: handle multi-line greeting messages X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/fb6179491e1a1c610c2e497f5268a0b35d0d61d1?hp=3b238b998632cc0324509f089b6e0ca3283f6485 handle multi-line greeting messages SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.33 --- diff --git a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c index 545a7b59bd..d80a5050ae 100644 --- a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c +++ b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c @@ -10,9 +10,9 @@ #ifndef lint #ifdef SMTP -static char sccsid[] = "@(#)srvrsmtp.c 8.32 (Berkeley) %G% (with SMTP)"; +static char sccsid[] = "@(#)srvrsmtp.c 8.33 (Berkeley) %G% (with SMTP)"; #else -static char sccsid[] = "@(#)srvrsmtp.c 8.32 (Berkeley) %G% (without SMTP)"; +static char sccsid[] = "@(#)srvrsmtp.c 8.33 (Berkeley) %G% (without SMTP)"; #endif #endif /* not lint */ @@ -125,13 +125,25 @@ smtp(e) setproctitle("server %s startup", CurSmtpClient); expand("\201e", inp, &inp[sizeof inp], e); + p = strchr(inp, '\n'); + if (p != NULL) + *p++ = '\0'; if (BrokenSmtpPeers) { message("220 %s", inp); } else { - message("220-%s", inp); + char *q = inp; + + while (q != NULL) + { + message("220-%s", q); + q = p; + p = strchr(p, '\n'); + if (p != NULL) + *p++ = '\0'; + } message("220 ESMTP spoken here"); } protocol = NULL;