]> Pileus Git - ~andy/fetchmail/commitdiff
Added Todd Sabin's new protocol options.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 22 Sep 1999 02:00:17 +0000 (02:00 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 22 Sep 1999 02:00:17 +0000 (02:00 -0000)
svn path=/trunk/; revision=2571

NEWS
fetchmail.c
fetchmail.h
fetchmail.man
imap.c
options.c
rcfile_l.l

diff --git a/NEWS b/NEWS
index e08ebe2f9c058e4f0173385ac28fbe13b4afe6b2..6e4f8e233eb1c12434a8375965ad249349d6fbfa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,9 @@ fetchmail-5.0.9 ():
 * Federico G. Schwindt's fix for NetBSD/OpenBSD --with-kerberos.
 * auth keyword and option changed to preauth.
 * Correct the exit value when .fetchmailrc permissions are wrong.
+* getmail/gotmail scripts by Thomas Nesges added to contrib.
+* Guenther H. Leber's fix for a ptential uid.c buffer overflow.
+* Todd Sabin's option to force IMAP authentication type.
 
 There are 264 people on fetchmail-friends and 441 on fetchmail-announce.
 
index 80a1556393c6811c142148660ccb66d5eb567d2e..ff465784dc5d9b965c44128cb55972130a163a31 100644 (file)
@@ -1335,6 +1335,8 @@ static int query_host(struct query *ctl)
        break;
     case P_IMAP:
     case P_IMAP_K4:
+    case P_IMAP_CRAM_MD5:
+    case P_IMAP_LOGIN:
 #ifdef GSSAPI
     case P_IMAP_GSS:
 #endif /* GSSAPI */
index c2b8b17ed8fbd72a94649bf087dce3634b324925..203877505861530d1b2a44b31eefc8ca3b52ebc0 100644 (file)
@@ -15,6 +15,8 @@
 #define                P_APOP          7
 #define                P_RPOP          8
 #define                P_ETRN          9
+#define                P_IMAP_CRAM_MD5 10
+#define                P_IMAP_LOGIN    11
 
 #if INET6
 #define                SMTP_PORT       "smtp"
index f6d2c24d4f7e2941bf3801e55f48230129dd19a6..66708520af07b6f85be3f6de3e5e7c4088460286 100644 (file)
@@ -190,6 +190,13 @@ with RFC 1731 Kerberos v4 preauthentication.
 .IP IMAP-GSS
 IMAP4, or IMAP4rev1 (\fIfetchmail\fR autodetects their capabilities)
 with RFC 1731 GSSAPI preauthentication.
+.IP IMAP-CRAMMD5
+IMAP4, or IMAP4rev1 (\fIfetchmail\fR autodetects their capabilities)
+with RFC 2195 CRAM-MD5 authentication.
+.IP IMAP-LOGIN
+IMAP4, or IMAP4rev1 (\fIfetchmail\fR autodetects their capabilities)
+with plain LOGIN authentication only, even if the server supports
+better methods.
 .IP ETRN
 Use the ESMTP ETRN option.
 .RE
diff --git a/imap.c b/imap.c
index f947c870f54f6a56fa5d977a30b98cd1bc223dba..24066fa11f6ed491d68321bdd18badc0562e34ab 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -960,13 +960,22 @@ int imap_getauth(int sock, struct query *ctl, char *greeting)
     {
         if (outlevel >= O_DEBUG)
             report (stdout, _("CRAM-MD5 authentication is supported\n"));
-        if ((ok = do_cram_md5 (sock, ctl)))
+        if (ctl->server.protocol != P_IMAP_LOGIN)
         {
-            if (outlevel >= O_MONITOR)
-                report (stdout, "IMAP> *\n");
-            SockWrite (sock, "*\r\n", 3);
+            if ((ok = do_cram_md5 (sock, ctl)))
+            {
+                if (outlevel >= O_MONITOR)
+                    report (stdout, "IMAP> *\n");
+                SockWrite (sock, "*\r\n", 3);
+            }
+            return ok;
         }
-        return ok;
+    }
+    else if (ctl->server.protocol == P_IMAP_CRAM_MD5)
+    {
+        report(stderr,
+               _("Required CRAM-MD5 capability not supported by server\n"));
+        return(PS_AUTHFAIL);
     }
 
 #ifdef NTLM_ENABLE
index 633629978ab4ad41559c5d29a7301782b5d8fa20..3338323fc00b935bb5bbd8e716be7e009edda757 100644 (file)
--- a/options.c
+++ b/options.c
@@ -346,6 +346,10 @@ struct query *ctl; /* option record to be initialized */
            else if (strcasecmp(optarg, "imap-gss") == 0)
                 ctl->server.protocol = P_IMAP_GSS;
 #endif /* GSSAPI */
+           else if (strcasecmp(optarg, "imap-crammd5") == 0)
+                ctl->server.protocol = P_IMAP_CRAM_MD5;
+           else if (strcasecmp(optarg, "imap-login") == 0)
+                ctl->server.protocol = P_IMAP_LOGIN;
            else if (strcasecmp(optarg,"etrn") == 0)
                ctl->server.protocol = P_ETRN;
            else {
index 06bda95067f295fc813c1c3c88f3a36472abc298..5980a6ce0dc9b0f95b568c4947a725d51755cc6d 100644 (file)
@@ -158,6 +158,8 @@ options             {/* EMPTY */}
 (pop3)|(POP3)  { yylval.proto = P_POP3;  return PROTO; }
 (imap-k4)|(IMAP-K4)   { yylval.proto = P_IMAP_K4;  return PROTO; }
 (imap-gss)|(IMAP-GSS) { yylval.proto = P_IMAP_GSS;  return PROTO; }
+(imap-crammd5)|(IMAP-CRAMMD5) { yylval.proto = P_IMAP_CRAM_MD5;  return PROTO; }
+(imap-login)|(IMAP-LOGIN) { yylval.proto = P_IMAP_LOGIN;  return PROTO; }
 (imap)|(IMAP)  { yylval.proto = P_IMAP;  return PROTO; }
 (apop)|(APOP)   { yylval.proto = P_APOP;  return PROTO; }
 (etrn)|(ETRN)   { yylval.proto = P_ETRN;  return PROTO; }