diff options
Diffstat (limited to 'src/qmail-smtpam.c')
-rw-r--r-- | src/qmail-smtpam.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qmail-smtpam.c b/src/qmail-smtpam.c index f5247dc..0cb8b3b 100644 --- a/src/qmail-smtpam.c +++ b/src/qmail-smtpam.c @@ -325,13 +325,14 @@ void tls_init() temp_tlserr(); } -int starttls_peer() +int ehlo_starttls() { int i = 0; - while ( (i += str_chr(smtptext.s + i,'\n') + 1) && - (i < smtptext.len - 8) ) { - if (!str_diffn(smtptext.s + i + 4,"STARTTLS",8)) return 1; } + do { + if (case_starts(smtptext.s + i + 4,"STARTTLS")) return 1; + } while ((i += str_chr(smtptext.s + i,'\n') + 1) && + (i - 12 < smtptext.len)); return 0; } @@ -430,7 +431,7 @@ void smtp() if (flagutf8mail) buffer_puts(&bo," SMTPUTF8"); if (flagtls > 0 && flagtls < 10) /* STARTTLS */ - if (starttls_peer()) { + if (ehlo_starttls()) { smtp_starttls(); } else if (flagtls > 2) { temp_tlshost(); |