summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-08-31 07:58:03 +0000
committerRichard M. Stallman <rms@gnu.org>1997-08-31 07:58:03 +0000
commit838bf4737fb66e6fdc44276500564a336ba9e79a (patch)
treea58f8630e4d9ee30a00b912313caad24e6ac3611 /lisp/gnus
parent095fb03edbc52f5d5047832cb4c798be7750bd13 (diff)
downloademacs-838bf4737fb66e6fdc44276500564a336ba9e79a.tar.gz
(pop3-md5): New function.
(pop3-apop): Use pop3-md5, not md5. (pop3-md5-program): New variable.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/pop3.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 95bd64ccaa4..7e6338b8ca3 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -265,15 +265,28 @@ Return the response string if optional second argument is non-nil."
(pop3-quit process)))))
))
+(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)
+ (or shell-file-name "/bin/sh")
+ t (current-buffer) nil
+ "-c" pop3-md5-program)
+ ;; The meaningful output is the first 32 characters.
+ ;; Don't return the newline that follows them!
+ (buffer-substring (point-min) (+ (point-min) 32))))
+
(defun pop3-apop (process user)
"Send alternate authentication information to the server."
- (if (not (fboundp 'md5)) (autoload 'md5 "md5"))
(let ((pass pop3-password))
(if (and pop3-password-required (not pass))
(setq pass
(pop3-read-passwd (format "Password for %s: " pop3-maildrop))))
(if pass
- (let ((hash (md5 (concat pop3-timestamp pass))))
+ (let ((hash (pop3-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)))