]> Pileus Git - ~andy/fetchmail/commitdiff
Workaround.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 26 Oct 1999 17:26:58 +0000 (17:26 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 26 Oct 1999 17:26:58 +0000 (17:26 -0000)
svn path=/trunk/; revision=2638

NEWS
imap.c

diff --git a/NEWS b/NEWS
index c041549a98be5d5b686ccb1905e0fa2cfee76773..3a6bd86e4f96377c462177627dd42112b2a2edac 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@
 
 (The `lines' figures total .c, .h, .l, and .y files under version control.)
 
+* Grant Edwards's patch to correct NTLM behavior.
+* In IMAP, set Seen flag explicity when keep is on; works around flaky
+  servers that don't set Seen on a body fetch.
+
 fetchmail-5.1.2 (Thu Oct  7 09:46:07 EDT 1999), 17906 lines:
 * Joe Loughry <loughry@uswest.net> sent a patch to handle multihomed machines.
 * Changed mimedecode default to `off'; it seems that doing RFC2047 decoding
diff --git a/imap.c b/imap.c
index 128d1e0f57e5cc24a23a5419fa3c4d0589e1480b..3039039f2206c7f5681ad7e8e32c9ef1c82e1ec5 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -982,13 +982,7 @@ int imap_getauth(int sock, struct query *ctl, char *greeting)
     {
         if (outlevel >= O_DEBUG)
             report (stdout, _("NTLM authentication is supported\n"));
-    if ((ok = do_imap_ntlm (sock, ctl)))
-        {
-            if (outlevel >= O_MONITOR)
-                report (stdout, "IMAP> *\n");
-            SockWrite (sock, "*\r\n", 3);
-        }
-        return ok;
+        return do_imap_ntlm (sock, ctl);
     }
 #endif /* NTLM_ENABLE */
 
@@ -1257,6 +1251,21 @@ static int imap_trail(int sock, struct query *ctl, int number)
        /* UW IMAP returns "OK FETCH", Cyrus returns "OK Completed" */
        if (strstr(buf, "OK"))
            break;
+
+       /*
+        * We've had a report of one server (not yet identified) that 
+        * fails to set SEEN on a body fetch.  This becomes an issue when
+        * keep is on, because seen messages aren't deleted and get
+        * refetched on each poll.  As a workaround, if keep is on
+        * we set the Seen flag explicitly.
+        */
+       if (ctl->keep)
+           if ((ok = gen_transact(sock,
+                       imap_version == IMAP4 
+                               ? "STORE %d +FLAGS.SILENT (\\Seen)"
+                               : "STORE %d +FLAGS (\\Seen)", 
+                       number)))
+               return(ok);
     }
 
     return(PS_SUCCESS);