Skip to content

Commit 030576e

Browse files
committed
mod_mail: Tolerate slower responses to LOGIN/AUTHENTICATE.
Previously, we only waited 2500 ms for a successful response to the LOGIN / AUTHENTICATE commands when logging into a remote IMAP server. This timeout occasionally expires with no response, particularly when talking to Gimap (Gmail). The old timeout was unreasonably low, so increase the timeout to 10 seconds. If we haven't gotten a response by then, then it's likelier that something is actually wrong. LBBS-94 #close
1 parent 2b75353 commit 030576e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/mod_mail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ int imap_client_login(struct bbs_tcp_client *client, struct bbs_url *url, struct
19971997

19981998
/* Gimap (Gmail) sends the capabilities again when you log in,
19991999
* so tolerate CAPABILITY then OK as well as just OK (possibly also with CAPABILITY). */
2000-
res = bbs_readline(client->rfd, &client->rldata, "\r\n", 2500);
2000+
res = bbs_readline(client->rfd, &client->rldata, "\r\n", SEC_MS(10));
20012001
if (res <= 0) {
20022002
bbs_warning("No response from IMAP server %s:%d?\n", url->host, url->port);
20032003
return -1;

0 commit comments

Comments
 (0)