/[emacs]/emacs/lisp/gnus/pop3.el
ViewVC logotype

Diff of /emacs/lisp/gnus/pop3.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21.2.1 by handa, Fri Mar 12 00:03:12 2004 UTC revision 1.21.2.2 by miles, Thu Sep 9 09:36:26 2004 UTC
# Line 1  Line 1 
1  ;;; pop3.el --- Post Office Protocol (RFC 1460) interface  ;;; pop3.el --- Post Office Protocol (RFC 1460) interface
2    
3  ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002  ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4  ;;        Free Software Foundation, Inc.  ;;        Free Software Foundation, Inc.
5    
6  ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>  ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
# Line 78  Used for APOP authentication.") Line 78  Used for APOP authentication.")
78      ;; query for password      ;; query for password
79      (if (and pop3-password-required (not pop3-password))      (if (and pop3-password-required (not pop3-password))
80          (setq pop3-password          (setq pop3-password
81                (pop3-read-passwd (format "Password for %s: " pop3-maildrop))))                (read-passwd (format "Password for %s: " pop3-maildrop))))
82      (cond ((equal 'apop pop3-authentication-scheme)      (cond ((equal 'apop pop3-authentication-scheme)
83             (pop3-apop process pop3-maildrop))             (pop3-apop process pop3-maildrop))
84            ((equal 'pass pop3-authentication-scheme)            ((equal 'pass pop3-authentication-scheme)
# Line 88  Used for APOP authentication.") Line 88  Used for APOP authentication.")
88      (setq message-count (car (pop3-stat process)))      (setq message-count (car (pop3-stat process)))
89      (unwind-protect      (unwind-protect
90          (while (<= n message-count)          (while (<= n message-count)
91            (message (format "Retrieving message %d of %d from %s..."            (message "Retrieving message %d of %d from %s..."
92                             n message-count pop3-mailhost))                     n message-count pop3-mailhost)
93            (pop3-retr process n crashbuf)            (pop3-retr process n crashbuf)
94            (save-excursion            (save-excursion
95              (set-buffer crashbuf)              (set-buffer crashbuf)
# Line 121  Used for APOP authentication.") Line 121  Used for APOP authentication.")
121      ;; query for password      ;; query for password
122      (if (and pop3-password-required (not pop3-password))      (if (and pop3-password-required (not pop3-password))
123          (setq pop3-password          (setq pop3-password
124                (pop3-read-passwd (format "Password for %s: " pop3-maildrop))))                (read-passwd (format "Password for %s: " pop3-maildrop))))
125      (cond ((equal 'apop pop3-authentication-scheme)      (cond ((equal 'apop pop3-authentication-scheme)
126             (pop3-apop process pop3-maildrop))             (pop3-apop process pop3-maildrop))
127            ((equal 'pass pop3-authentication-scheme)            ((equal 'pass pop3-authentication-scheme)
# Line 177  Return the response string if optional s Line 177  Return the response string if optional s
177      (save-excursion      (save-excursion
178        (set-buffer (process-buffer process))        (set-buffer (process-buffer process))
179        (goto-char pop3-read-point)        (goto-char pop3-read-point)
180        (while (not (search-forward "\r\n" nil t))        (while (and (memq (process-status process) '(open run))
181          (accept-process-output process 3)                    (not (search-forward "\r\n" nil t)))
182            (nnheader-accept-process-output process)
183          (goto-char pop3-read-point))          (goto-char pop3-read-point))
184        (setq match-end (point))        (setq match-end (point))
185        (goto-char pop3-read-point)        (goto-char pop3-read-point)
# Line 192  Return the response string if optional s Line 193  Return the response string if optional s
193              t)              t)
194            )))))            )))))
195    
 (defvar pop3-read-passwd nil)  
 (defun pop3-read-passwd (prompt)  
   (if (not pop3-read-passwd)  
       (if (fboundp 'read-passwd)  
           (setq pop3-read-passwd 'read-passwd)  
         (if (load "passwd" t)  
             (setq pop3-read-passwd 'read-passwd)  
           (autoload 'ange-ftp-read-passwd "ange-ftp")  
           (setq pop3-read-passwd 'ange-ftp-read-passwd))))  
   (funcall pop3-read-passwd prompt))  
   
196  (defun pop3-clean-region (start end)  (defun pop3-clean-region (start end)
197    (setq end (set-marker (make-marker) end))    (setq end (set-marker (make-marker) end))
198    (save-excursion    (save-excursion
# Line 263  If NOW, use that time instead." Line 253  If NOW, use that time instead."
253              ;; Tue Jul 9 09:04:21 1996              ;; Tue Jul 9 09:04:21 1996
254              (setq date              (setq date
255                    (cond ((not date)                    (cond ((not date)
256                          "Tue Jan 1 00:00:0 1900")                           "Tue Jan 1 00:00:0 1900")
257                          ((string-match "[A-Z]" (nth 0 date))                          ((string-match "[A-Z]" (nth 0 date))
258                           (format "%s %s %s %s %s"                           (format "%s %s %s %s %s"
259                                   (nth 0 date) (nth 2 date) (nth 1 date)                                   (nth 0 date) (nth 2 date) (nth 1 date)
# Line 316  If NOW, use that time instead." Line 306  If NOW, use that time instead."
306    (let ((pass pop3-password))    (let ((pass pop3-password))
307      (if (and pop3-password-required (not pass))      (if (and pop3-password-required (not pass))
308          (setq pass          (setq pass
309                (pop3-read-passwd (format "Password for %s: " pop3-maildrop))))                (read-passwd (format "Password for %s: " pop3-maildrop))))
310      (if pass      (if pass
311          (let ((hash (pop3-md5 (concat pop3-timestamp pass))))          (let ((hash (pop3-md5 (concat pop3-timestamp pass))))
312            (pop3-send-command process (format "APOP %s %s" user hash))            (pop3-send-command process (format "APOP %s %s" user hash))
# Line 363  This function currently does nothing.") Line 353  This function currently does nothing.")
353      (save-excursion      (save-excursion
354        (set-buffer (process-buffer process))        (set-buffer (process-buffer process))
355        (while (not (re-search-forward "^\\.\r\n" nil t))        (while (not (re-search-forward "^\\.\r\n" nil t))
356          (accept-process-output process 3)          ;; Fixme: Shouldn't depend on nnheader.
357            (nnheader-accept-process-output process)
358          ;; bill@att.com ... to save wear and tear on the heap          ;; bill@att.com ... to save wear and tear on the heap
359          ;; uncommented because the condensed version below is a problem for          ;; uncommented because the condensed version below is a problem for
360          ;; some.          ;; some.

Legend:
Removed from v.1.21.2.1  
changed lines
  Added in v.1.21.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26