X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fpop3.el;h=2e9f2ea4d5ea002e1ee4b7e1c8e5e5b0587de246;hb=9c12c8a1215cda2d292be3989354e925ea19b143;hp=b192853b92a0e6c6a898bd0d861d288b4a8c8707;hpb=75e6d317f5a39e63ee8f17fb9b4836d5c9c14251;p=gnus diff --git a/lisp/pop3.el b/lisp/pop3.el index b192853b9..2e9f2ea4d 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -36,6 +36,7 @@ ;;; Code: (require 'mail-utils) +(require 'nnheader) (defvar pop3-maildrop (or (user-login-name) (getenv "LOGNAME") (getenv "USER") nil) "*POP3 maildrop.") @@ -173,7 +174,8 @@ Return the response string if optional second argument is non-nil." (save-excursion (set-buffer (process-buffer process)) (goto-char pop3-read-point) - (while (not (search-forward "\r\n" nil t)) + (while (and (memq (process-status process) '(open run)) + (not (search-forward "\r\n" nil t))) (nnheader-accept-process-output process) (goto-char pop3-read-point)) (setq match-end (point)) @@ -303,7 +305,7 @@ If NOW, use that time instead." (setq pass (read-passwd (format "Password for %s: " pop3-maildrop)))) (if pass - (let ((hash (pop3-md5 (concat pop3-timestamp pass)))) + (let ((hash (md5 (concat pop3-timestamp pass)))) (pop3-send-command process (format "APOP %s %s" user hash)) (let ((response (pop3-read-response process t))) (if (not (and response (string-match "+OK" response))) @@ -312,22 +314,6 @@ If NOW, use that time instead." ;; TRANSACTION STATE -(eval-and-compile - (if (fboundp 'md5) - (defalias 'pop3-md5 'md5) - (defvar pop3-md5-program "md5" - "*Program to encode its input in MD5.") - - (defun pop3-md5 (string) - (with-temp-buffer - (insert string) - (call-process-region (point-min) (point-max) - pop3-md5-program - t (current-buffer) nil) - ;; The meaningful output is the first 32 characters. - ;; Don't return the newline that follows them! - (buffer-substring (point-min) (+ 32 (point-min))))))) - (defun pop3-stat (process) "Return the number of messages in the maildrop and the maildrop's size." (pop3-send-command process "STAT") @@ -500,4 +486,5 @@ and close the connection." (provide 'pop3) +;;; arch-tag: 2facc142-1d74-498e-82af-4659b64cac12 ;;; pop3.el ends here