You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

603288-split-fetches.patch 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. From: Antonio Radici <antonio@debian.org>
  2. Date: Thu, 27 Feb 2014 17:16:58 +0100
  3. Subject: 603288-split-fetches
  4. A workaround for Exchange 2010 IMAP protocol,
  5. tracked in http://bugs.mutt.org/3459,
  6. already merged in the ubuntu version of Mutt.
  7. Gbp-Pq: Topic upstream
  8. ---
  9. imap/message.c | 9 +++++++++
  10. 1 file changed, 9 insertions(+)
  11. diff --git a/imap/message.c b/imap/message.c
  12. index 3504be8..4234e22 100644
  13. --- a/imap/message.c
  14. +++ b/imap/message.c
  15. @@ -240,6 +240,15 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
  16. char *cmd;
  17. fetchlast = msgend + 1;
  18. + /* Microsoft Exchange 2010 violates the IMAP protocol and
  19. + * starts omitting messages if one FETCHes more than 2047 (or
  20. + * or somewhere around that number. We therefore split the
  21. + * FETCH into chunks of 2000 messages each */
  22. + if (fetchlast - msgno - 1 > 2000)
  23. + {
  24. + fetchlast = msgno+1 + 2000;
  25. + }
  26. +
  27. safe_asprintf (&cmd, "FETCH %d:%d (UID FLAGS INTERNALDATE RFC822.SIZE %s)",
  28. msgno + 1, fetchlast, hdrreq);
  29. imap_cmd_start (idata, cmd);