[mew-dist 18590] Re: X-UIDL:

Kazu Yamamoto ( 山本和彦 ) kazu at example.com
2001年 8月 29日 (水) 15:19:22 JST


From: OHARA Shigeki <os at example.com>
Subject: [mew-dist 18575] X-UIDL:

> S: 2 
> 
> ということになってしまう POP サーバがあるようで、
> Mew 2.0.50 では、こういう場合、
> X-UIDL: が空のメッセージを取り込むことができないようです。
  
このパッチを試して下さい。

--かず

Index: mew-pop.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-pop.el,v
retrieving revision 1.13
diff -c -r1.13 mew-pop.el
*** mew-pop.el	2001/08/07 07:37:46	1.13
--- mew-pop.el	2001/08/29 05:44:25
***************
*** 554,570 ****
  	(sul (mew-pop-get-sul pnm))           ;; (siz uid lmsg)
  	(old-uidl (mew-pop-uidl-db-get pnm))
  	num siz uid msgs uidl n siz-uid-lmsg)
!     (while (re-search-forward "^\\([0-9]+\\) +\\([!-~]+\\)" nil t)
        (setq num (mew-match 1))
        (setq uid (mew-match 2))
        (cond
         (sul ;; (num siz uidl lmsg)
  	(if (setq siz-uid-lmsg (mew-assoc-equal uid sul 1))
  	    (setq msgs (cons (cons num siz-uid-lmsg) msgs))))
         (t ;; (num siz uidl)
! 	(setq uidl (cons uid uidl))
! 	(if (member uid old-uidl)
! 	    ()
  	  (setq siz (nth 1 (assoc num old-msgs)))
  	  (setq msgs (cons (list num siz uid) msgs))))))
      (mew-pop-set-uidl pnm uidl)
--- 554,571 ----
  	(sul (mew-pop-get-sul pnm))           ;; (siz uid lmsg)
  	(old-uidl (mew-pop-uidl-db-get pnm))
  	num siz uid msgs uidl n siz-uid-lmsg)
!     (while (re-search-forward "^\\([0-9]+\\) +\\([!-~]*\\)" nil t)
        (setq num (mew-match 1))
        (setq uid (mew-match 2))
+       ;; A broken POP server may return a null UID.
+       (if (string= uid "") (setq uid nil))
        (cond
         (sul ;; (num siz uidl lmsg)
  	(if (setq siz-uid-lmsg (mew-assoc-equal uid sul 1))
  	    (setq msgs (cons (cons num siz-uid-lmsg) msgs))))
         (t ;; (num siz uidl)
! 	(if uid (setq uidl (cons uid uidl)))
! 	(unless (member uid old-uidl) ;; old-uidl doesn't contain nil.
  	  (setq siz (nth 1 (assoc num old-msgs)))
  	  (setq msgs (cons (list num siz uid) msgs))))))
      (mew-pop-set-uidl pnm uidl)



Mew-dist メーリングリストの案内