]> Pileus Git - ~andy/fetchmail/commitdiff
Support NIL as body length (Exchange). Fixes Berlios Bug #11980.
authorMatthias Andree <matthias.andree@gmx.de>
Thu, 23 Apr 2009 14:39:48 +0000 (14:39 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Thu, 23 Apr 2009 14:39:48 +0000 (14:39 -0000)
svn path=/branches/BRANCH_6-3/; revision=5269

NEWS
imap.c

diff --git a/NEWS b/NEWS
index 55c2d18ac5917f3a1248c49808f2b736bb077796..98147a43456a31e75cd115e4958bef30ed2afdf7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,8 @@ fetchmail 6.3.10 (not yet released):
   Courtesy of Nico Golde, Debian.
 * When a pre- or post-connect command fails, now report the exit status or
   termination signal properly through sys/wait.h macros.
+* When acquiring a body, understand NIL ("no such data item"), as returned by
+  some MS Exchange versions. Fixes BerliOS Bug #11980 by KB Sriram.
 
 # CHANGES
 * Make the comparison of the SSL fingerprints case insensitive, to
diff --git a/imap.c b/imap.c
index dd303f78513be2cd086929afdedeec9195deacf3..53474924c53346f4dd272b3acdff5287d96252ef 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -1153,6 +1153,13 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp)
     if (num != number)
        return(PS_ERROR);
 
+    /* Understand "NIL" as length => no body present
+     * (MS Exchange, BerliOS Bug #11980) */
+    if (strstr(buf+10, "NIL)")) {
+           *lenp = 0;
+           return PS_SUCCESS;
+    }
+
     /*
      * Try to extract a length from the FETCH response.  RFC2060 requires
      * it to be present, but at least one IMAP server (Novell GroupWise)