diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-09-30 17:06:21 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-09-30 17:06:21 +0000 |
commit | 3e03d50356bef6820d79e94a8519213f2bfcd9e3 (patch) | |
tree | 4d08c8b2b9d98159e996b3bef6305c158c31ba9c /driver.c | |
parent | 840a99ec74300f9802ef80dfed53765db9de8a93 (diff) | |
download | fetchmail-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.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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) |