|
|
|
@ -76,5 +76,17 @@ int imap_auth(struct tlsport *p, struct ejabber_msg *m)
|
|
|
|
|
|
|
|
|
|
if(strncmp(buf, "a OK", 4)) return -1;
|
|
|
|
|
|
|
|
|
|
/* check for leftovers */
|
|
|
|
|
if(len == IMAPLINE_LENGTH - sizeof(char)) {
|
|
|
|
|
do {
|
|
|
|
|
len = tls_io(p, buf, IMAPLINE_LENGTH - sizeof(char), TLSIO_READ);
|
|
|
|
|
} while(len == IMAPLINE_LENGTH - sizeof(char));
|
|
|
|
|
memset(buf, '\0', IMAPLINE_LENGTH);
|
|
|
|
|
} else memset(buf, '\0', len = sizeof(char));
|
|
|
|
|
|
|
|
|
|
/* say logout */
|
|
|
|
|
snprintf(buf, IMAPLINE_LENGTH - sizeof(char), "a logout");
|
|
|
|
|
len = tls_io(p, buf, 9, TLSIO_WRITE);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|