]> git.eshelyaron.com Git - emacs.git/commitdiff
(pop3-open-server): Fix typo.
authorEli Zaretskii <eliz@gnu.org>
Wed, 12 Jun 2002 17:32:52 +0000 (17:32 +0000)
committerEli Zaretskii <eliz@gnu.org>
Wed, 12 Jun 2002 17:32:52 +0000 (17:32 +0000)
(pop3-munge-message-separator): Work if no date.
Trivial patch from Marius Vollmer <mvo@zagadka.ping.de>.
(pop3-munge-message-separator): Only use valid date.
Trivial patch from Michael Welsh Duggan <md5i@cs.cmu.edu>.
(pop3-md5): Don't hardcode point-min == 1.

lisp/gnus/pop3.el

index 99148388aa8a0280a1ea61b54d1e63d9e1a9df6e..192c8f332dde419a0e9689f77ce3674891f43503 100644 (file)
@@ -1,6 +1,6 @@
 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
@@ -139,7 +139,7 @@ Returns the process associated with the connection."
                                             mailhost)))
       (erase-buffer)
       (setq pop3-read-point (point-min))
-      (setq process (open-network-stream "POP"(current-buffer) mailhost port))
+      (setq process (open-network-stream "POP" (current-buffer) mailhost port))
       (let ((response (pop3-read-response process t)))
        (setq pop3-timestamp
              (substring response (or (string-match "<" response) 0)
@@ -244,18 +244,23 @@ If NOW, use that time instead."
                   (looking-at "\001\001\001\001\n") ; MMDF
                   (looking-at "BABYL OPTIONS:") ; Babyl
                   ))
-         (let ((from (mail-strip-quoted-names (mail-fetch-field "From")))
-               (date (split-string (or (mail-fetch-field "Date")
-                                       (pop3-make-date))
-                                   " "))
-               (From_))
+         (let* ((from (mail-strip-quoted-names (mail-fetch-field "From")))
+                (tdate (mail-fetch-field "Date"))
+                (date (split-string (or (and tdate
+                                             (not (string= "" tdate))
+                                             tdate)
+                                        (pop3-make-date))
+                                    " "))
+                (From_))
            ;; sample date formats I have seen
            ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT)
            ;; Date: 08 Jul 1996 23:22:24 -0400
            ;; should be
            ;; Tue Jul 9 09:04:21 1996
            (setq date
-                 (cond ((string-match "[A-Z]" (nth 0 date))
+                 (cond ((not date)
+                        "Tue Jan 1 00:00:0 1900")
+                       ((string-match "[A-Z]" (nth 0 date))
                         (format "%s %s %s %s %s"
                                 (nth 0 date) (nth 2 date) (nth 1 date)
                                 (nth 4 date) (nth 3 date)))
@@ -332,7 +337,7 @@ If NOW, use that time instead."
                             t (current-buffer) nil)
        ;; The meaningful output is the first 32 characters.
        ;; Don't return the newline that follows them!
-       (buffer-substring 1 33)))))
+       (buffer-substring (point-min) (+ 32 (point-min)))))))
 
 (defun pop3-stat (process)
   "Return the number of messages in the maildrop and the maildrop's size."