-(static-unless (and (fboundp 'md5) (subrp (symbol-function 'md5)))
- (eval-and-compile
- (require 'path-util)
- (if (module-installed-p 'md5)
- (progn
- (autoload 'md5 "md5")
- (fset '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)
- (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))))
- )))
+;; Note that `pop3-md5' won't encode a given string to use for the
+;; apop authentication.
+(eval-and-compile
+ (if (and (fboundp 'md5)
+ (subrp (symbol-function 'md5)))
+ (if (condition-case nil
+ (md5 "Check whether the 3rd argument CODING is allowed"
+ nil nil 'binary)
+ (error nil))
+ ;; XEmacs 20
+ (defalias 'pop3-md5 'md5)
+ ;; Emacs 21 or XEmacs 21
+ (defun pop3-md5 (string)
+ (md5 string nil nil 'binary)))
+ ;; The lisp function provided by FLIM
+ (autoload 'md5 "md5")
+ (defalias 'pop3-md5 'md5)))