aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2011-05-22 23:14:01 +0200
committerMatthias Andree <matthias.andree@gmx.de>2011-05-26 23:14:43 +0200
commit467f2ff46ce1896a5445e06a60dae2aa6dcaf071 (patch)
treec3c8c423c2fdb1ded6f60d70f99afe3dba6b3214 /imap.c
parent68accfa42c00af928e2081b8ca9b47728eb228ae (diff)
downloadfetchmail-467f2ff46ce1896a5445e06a60dae2aa6dcaf071.tar.gz
fetchmail-467f2ff46ce1896a5445e06a60dae2aa6dcaf071.tar.bz2
fetchmail-467f2ff46ce1896a5445e06a60dae2aa6dcaf071.zip
Handle socket errors on CAPABILITY probes.
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/imap.c b/imap.c
index 0bbf06db..dca3bab9 100644
--- a/imap.c
+++ b/imap.c
@@ -324,7 +324,7 @@ static void imap_canonicalize(char *result, char *raw, size_t maxlen)
result[j] = '\0';
}
-static void capa_probe(int sock, struct query *ctl)
+static int capa_probe(int sock, struct query *ctl)
/* set capability variables from a CAPA probe */
{
int ok;
@@ -360,6 +360,8 @@ static void capa_probe(int sock, struct query *ctl)
if (outlevel >= O_DEBUG)
report(stdout, GT_("Protocol identified as IMAP2 or IMAP2BIS\n"));
}
+ else
+ return ok;
/*
* Handle idling. We depend on coming through here on startup
@@ -377,6 +379,8 @@ static void capa_probe(int sock, struct query *ctl)
}
peek_capable = (imap_version >= IMAP4);
+
+ return PS_SUCCESS;
}
static int do_authcert (int sock, const char *command, const char *name)
@@ -412,7 +416,8 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
else
expunge_period = 1;
- capa_probe(sock, ctl);
+ if ((ok = capa_probe(sock, ctl)))
+ return ok;
/*
* If either (a) we saw a PREAUTH token in the greeting, or
@@ -459,7 +464,8 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
* Now that we're confident in our TLS connection we can
* guarantee a secure capability re-probe.
*/
- capa_probe(sock, ctl);
+ if ((ok = capa_probe(sock, ctl)))
+ return ok;
if (outlevel >= O_VERBOSE)
{
report(stdout, GT_("%s: upgrade to TLS succeeded.\n"), commonname);