diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-02-10 12:19:10 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-02-10 12:19:10 +0000 |
commit | c76cb3da047790a1c1fc0f0361feee410515a1e4 (patch) | |
tree | 9a39091a0f16f54af6a467a03a133d97fb6fb6cc /lib/smtp.c | |
parent | 2f66ca11c1aaa85343cedeccdfa9804614500b58 (diff) |
smtp: Added support for the STLS capability (Part One)
Introduced detection of the STARTTLS capability, in order to add support
for TLS upgrades without unconditionally sending the STARTTLS command.
Diffstat (limited to 'lib/smtp.c')
-rw-r--r-- | lib/smtp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index dd08575be..6b4f88559 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -228,8 +228,12 @@ static int smtp_endofresp(struct pingpong *pp, int *resp) line += 4; len -= 4; + /* Does the server support the STARTTLS capability? */ + if(len >= 8 && !memcmp(line, "STARTTLS", 8)) + smtpc->tls_supported = TRUE; + /* Does the server support the SIZE capability? */ - if(len >= 4 && !memcmp(line, "SIZE", 4)) + else if(len >= 4 && !memcmp(line, "SIZE", 4)) smtpc->size_supported = TRUE; /* Do we have the authentication mechanism list? */ @@ -237,6 +241,7 @@ static int smtp_endofresp(struct pingpong *pp, int *resp) line += 5; len -= 5; + /* Loop through the data line */ for(;;) { while(len && (*line == ' ' || *line == '\t' || |