? netrc+encrypt.patch Index: encrypt.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/encrypt.el,v retrieving revision 7.11 diff -u -r7.11 encrypt.el --- encrypt.el 1 Nov 2007 15:01:11 -0000 7.11 +++ encrypt.el 17 Dec 2007 22:55:28 -0000 @@ -29,11 +29,12 @@ ;;; particular aspect. ;;; Use in Gnus like this: +;;; (require 'encrypt) ;;; (setq ;;; nnimap-authinfo-file "~/.authinfo.enc" ;;; nntp-authinfo-file "~/.authinfo.enc" ;;; smtpmail-auth-credentials "~/.authinfo.enc" -;;; ;; using the AES256 cipher, feel free to use your own favorite +;;; ;; GnuPG using the AES256 cipher, feel free to use your own favorite ;;; encrypt-file-alist (quote (("~/.authinfo.enc" (gpg "AES256")))) ;;; password-cache-expiry 600) @@ -53,7 +54,9 @@ ;; autoload password (eval-and-compile - (autoload 'password-read "password")) + (if (locate-library "password-cache") + (require 'password-cache) + (require 'password))) (defgroup encrypt '((password-cache custom-variable) (password-cache-expiry custom-variable)) Index: netrc.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/netrc.el,v retrieving revision 7.17 diff -u -r7.17 netrc.el --- netrc.el 9 Dec 2007 00:04:21 -0000 7.17 +++ netrc.el 17 Dec 2007 22:55:28 -0000 @@ -34,6 +34,10 @@ ;;; .netrc and .authinfo rc parsing ;;; +;; use encrypt if loaded (but netrc-use-encrypt also has to be on) +(eval-and-compile + (autoload 'encrypt-find-model "encrypt") + (autoload 'encrypt-insert-file-contents "encrypt")) (defalias 'netrc-point-at-eol (if (fboundp 'point-at-eol) 'point-at-eol @@ -54,8 +58,12 @@ (let ((tokens '("machine" "default" "login" "password" "account" "macdef" "force" "port")) + (encryption-model (when (bound-and-true-p encrypt-file-alist) + (encrypt-find-model file))) alist elem result pair) - (insert-file-contents file) + (if encryption-model + (encrypt-insert-file-contents file encryption-model) + (insert-file-contents file)) (goto-char (point-min)) ;; Go through the file, line by line. (while (not (eobp))