aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-09-30 17:06:21 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-09-30 17:06:21 +0000
commit3e03d50356bef6820d79e94a8519213f2bfcd9e3 (patch)
tree4d08c8b2b9d98159e996b3bef6305c158c31ba9c /driver.c
parent840a99ec74300f9802ef80dfed53765db9de8a93 (diff)
downloadfetchmail-3e03d50356bef6820d79e94a8519213f2bfcd9e3.tar.gz
fetchmail-3e03d50356bef6820d79e94a8519213f2bfcd9e3.tar.bz2
fetchmail-3e03d50356bef6820d79e94a8519213f2bfcd9e3.zip
Get byte-stuiffing and byte-stripping right.
svn path=/trunk/; revision=1436
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c17
1 files changed, 15 insertions, 2 deletions
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 .<CR><LF> 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)