(imap-parse-body):
authorSimon Josefsson <jas@extundo.com>
Sat, 5 Aug 2000 12:51:35 +0000 (12:51 +0000)
committerSimon Josefsson <jas@extundo.com>
Sat, 5 Aug 2000 12:51:35 +0000 (12:51 +0000)
(imap-parse-string-list): Add bug workarounds for Stalker
Communigate Pro 3.0 server.
(imap-body-lines): Remove bogus comment.
(imap-range-to-message-set): Move from nnimap.el.

lisp/ChangeLog
lisp/imap.el

index ba8b911..0c434d8 100644 (file)
@@ -1,3 +1,17 @@
+2000-08-09  Simon Josefsson <simon@josefsson.org>
+
+       * imap.el (imap-parse-body):
+       (imap-parse-string-list): Add bug workarounds for Stalker
+       Communigate Pro 3.0 server.
+       (imap-body-lines): Remove bogus comment.
+
+       * imap.el (imap-range-to-message-set): Move from nnimap.el.
+
+       * nnimap.el (nnimap-retrieve-which-headers):
+       (nnimap-retrieve-headers-from-server):
+       (nnimap-request-set-mark):
+       (nnimap-request-expire-articles): Use `i-r-t-m-set' instead.
+
 2000-08-08 00:53:41  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-dont-reply-to-names):
index be2e3ef..d0d5902 100644 (file)
@@ -1233,6 +1233,18 @@ returned, if ITEMS is a symbol only it's value is returned."
               (list list))
             ","))
 
+(defun imap-range-to-message-set (range)
+  (mapconcat
+   (lambda (item)
+     (if (consp item)
+         (format "%d:%d"
+                 (car item) (cdr item))
+       (format "%d" item)))
+   (if (and (listp range) (not (listp (cdr range))))
+       (list range) ;; make (1 . 2) into ((1 . 2))
+     range)
+   ","))
+
 (defun imap-fetch-asynch (uids props &optional nouidfetch buffer)
   (with-current-buffer (or buffer (current-buffer))
     (imap-send-command (format "%sFETCH %s %s" (if nouidfetch "" "UID ")
@@ -1446,7 +1458,6 @@ on failure."
   "Return number of lines in article by looking at the mime bodystructure BODY."
   (if (listp body)
       (if (stringp (car body))
-          ;; upcase for bug in courier imap server
          (cond ((and (string= (upcase (car body)) "TEXT")
                      (numberp (nth 7 body)))
                 (nth 7 body))
@@ -2226,7 +2237,10 @@ Return nil if no complete line has arrived."
           (imap-forward)
           (while (setq str (imap-parse-string))
             (push str strlist)
-            (imap-forward))
+            ;; buggy stalker communigate pro 3.0 doesn't print SPC
+            ;; between body-fld-param's sometimes
+            (or (eq (char-after) ?\")
+                (imap-forward)))
           (nreverse strlist)))
        ((imap-parse-nil)
         nil)))
@@ -2357,6 +2371,11 @@ Return nil if no complete line has arrived."
          (let (subbody)
            (while (and (eq (char-after) ?\()
                        (setq subbody (imap-parse-body)))
+             ;; buggy stalker communigate pro 3.0 insert a SPC between
+             ;; parts in multiparts
+             (when (and (eq (char-after) ?\ )
+                        (eq (char-after (1+ (point))) ?\())
+               (imap-forward))
              (push subbody body))
            (imap-forward)
            (push (imap-parse-string) body);; media-subtype
@@ -2406,12 +2425,16 @@ Return nil if no complete line has arrived."
                   (push (imap-parse-envelope) body);; envelope
                   (imap-forward)
                   (push (imap-parse-body) body);; body
-                  (imap-forward)
-                  (push (imap-parse-number) body));; body-fld-lines
-                 ((setq lines (imap-parse-number));; body-type-text:
-                  (push lines body));; body-fld-lines
+                  ;; buggy stalker communigate pro 3.0 doesn't print
+                  ;; number of lines in message/rfc822 attachment
+                  (if (eq (char-after) ?\))
+                      (push 0 body)
+                    (imap-forward)
+                    (push (imap-parse-number) body))) ;; body-fld-lines
+                 ((setq lines (imap-parse-number))    ;; body-type-text:
+                  (push lines body))                  ;; body-fld-lines
                  (t
-                  (backward-char)))));; no match...
+                  (backward-char)))))                 ;; no match...
 
        ;; ...and then parse the third one here...