From 3e03d50356bef6820d79e94a8519213f2bfcd9e3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 30 Sep 1997 17:06:21 +0000 Subject: Get byte-stuiffing and byte-stripping right. svn path=/trunk/; revision=1436 --- driver.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index db8b0dd4..f4cba8fb 100644 --- a/driver.c +++ b/driver.c @@ -464,8 +464,21 @@ static int stuffline(struct query *ctl, char *buf) * use . as EOM. If it does, the server will already have * decorated any . lines it sends back up. */ - if (!protocol->delimited && *buf == '.' && ctl->smtp_socket != -1) - SockWrite(ctl->smtp_socket, buf, 1); + if (*buf == '.') + if (protocol->delimited) /* server has already byte-stuffed */ + { + if (ctl->mda) + ++buf; + else + /* writing to SMTP, leave the byte-stuffing in place */; + } + else /* if (!protocol->delimited) /* not byte-stuffed already */ + { + if (!ctl->mda) + SockWrite(ctl->smtp_socket, buf, 1); /* byte-stuff it */ + else + /* leave it alone */; + } /* we may need to strip carriage returns */ if (ctl->stripcr) -- cgit v1.2.3