--- fetchmail-6.2.2/pop3.c 2003-02-28 12:44:57.000000000 +0100 +++ fetchmail-6.2.2-fixed/pop3.c 2003-06-09 17:05:53.000000000 +0200 @@ -354,9 +354,8 @@ } #endif /* OPIE_ENABLE */ - if (has_cram && - (ctl->server.authenticate == A_CRAM_MD5 || - ctl->server.authenticate == A_ANY)) + if (ctl->server.authenticate == A_CRAM_MD5 || + (has_cram && ctl->server.authenticate == A_ANY)) { ok = do_cram_md5(sock, "AUTH", ctl, NULL); if (ok == PS_SUCCESS || ctl->server.authenticate != A_ANY) --- fetchmail-6.2.2/imap.c 2003-03-01 03:11:36.000000000 +0100 +++ fetchmail-6.2.2-fixed/imap.c 2003-06-09 17:07:29.000000000 +0200 @@ -416,9 +416,8 @@ * in a challenge-response. */ - if ((ctl->server.authenticate == A_ANY - || ctl->server.authenticate == A_CRAM_MD5) - && strstr(capabilities, "AUTH=CRAM-MD5")) + if ((ctl->server.authenticate == A_ANY && strstr(capabilities, "AUTH=CRAM-MD5")) + || ctl->server.authenticate == A_CRAM_MD5) { if ((ok = do_cram_md5 (sock, "AUTHENTICATE", ctl, NULL))) {