aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-11-29 00:42:16 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-11-29 00:42:16 +0000
commit0c9e0b65af1aa77f3ec57506eac0812a4ccfbf55 (patch)
tree32672885336a5c657b69c9cc3cfdee7a2c74e85e /pop3.c
parent578f08efcfd520bfe7dea9d45b19a0d49ac2aee3 (diff)
downloadfetchmail-0c9e0b65af1aa77f3ec57506eac0812a4ccfbf55.tar.gz
fetchmail-0c9e0b65af1aa77f3ec57506eac0812a4ccfbf55.tar.bz2
fetchmail-0c9e0b65af1aa77f3ec57506eac0812a4ccfbf55.zip
Fix bogus authentication failure with --auth password when CAPA fails.
svn path=/branches/BRANCH_6-3/; revision=4976
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/pop3.c b/pop3.c
index 94afa744..3acc5923 100644
--- a/pop3.c
+++ b/pop3.c
@@ -444,22 +444,26 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
(ok == PS_SOCKET && !ctl->wehaveauthed))
{
#ifdef SSL_ENABLE
- if (must_tls(ctl))
+ if (must_tls(ctl)) {
/* fail with mandatory STLS without repoll */
+ report(stderr, GT_("TLS is mandatory for this session, but server refused CAPA command.\n"));
+ report(stderr, GT_("The CAPA command is however necessary for TLS.\n"));
return ok;
- else {
+ } else {
/* defeat opportunistic STLS */
xfree(ctl->sslproto);
ctl->sslproto = xstrdup("");
}
#endif
- /* If strong authentication was opportunistic, retry
- * without, else fail. */
- if (ctl->server.authenticate == A_ANY) {
- ctl->server.authenticate = A_PASSWORD;
- return PS_REPOLL;
- } else {
- return PS_AUTHFAIL;
+ /* If strong authentication was opportunistic, retry without, else fail. */
+ switch (ctl->server.authenticate) {
+ case A_ANY:
+ ctl->server.authenticate = A_PASSWORD;
+ /* FALLTHROUGH */
+ case A_PASSWORD: /* this should only happen with TLS enabled */
+ return PS_REPOLL;
+ default:
+ return PS_AUTHFAIL;
}
}
}