[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el |
Date: |
Thu, 25 Apr 2002 19:39:21 -0400 |
Index: emacs/lisp/mail/smtpmail.el
diff -c emacs/lisp/mail/smtpmail.el:1.39 emacs/lisp/mail/smtpmail.el:1.40
*** emacs/lisp/mail/smtpmail.el:1.39 Thu Apr 25 17:45:22 2002
--- emacs/lisp/mail/smtpmail.el Thu Apr 25 19:39:21 2002
***************
*** 40,46 ****
;;(setq smtpmail-local-domain "YOUR DOMAIN NAME")
;;(setq smtpmail-sendto-domain "YOUR DOMAIN NAME")
;;(setq smtpmail-debug-info t) ; only to debug problems
! ;;(setq smtpmail-auth-credentials
;; '(("YOUR SMTP HOST" 25 "username" "password")))
;;(setq smtpmail-starttls-credentials
;; '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert")))
--- 40,46 ----
;;(setq smtpmail-local-domain "YOUR DOMAIN NAME")
;;(setq smtpmail-sendto-domain "YOUR DOMAIN NAME")
;;(setq smtpmail-debug-info t) ; only to debug problems
! ;;(setq smtpmail-auth-credentials ; or use ~/.authinfo
;; '(("YOUR SMTP HOST" 25 "username" "password")))
;;(setq smtpmail-starttls-credentials
;; '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert")))
***************
*** 73,78 ****
--- 73,79 ----
(autoload 'message-make-date "message")
(autoload 'message-make-message-id "message")
(autoload 'rfc2104-hash "rfc2104")
+ (autoload 'netrc-parse "netrc")
;;;
(defgroup smtpmail nil
***************
*** 150,168 ****
:type 'directory
:group 'smtpmail)
! (defcustom smtpmail-auth-credentials '(("" 25 "" nil))
! "Specify username and password for servers.
! It is a list of four-element lists that contain, in order,
`servername' (a string), `port' (an integer), `user' (a string) and
! `password' (a string, or nil to query the user when needed).
! If you need to enter a `realm' too, add it to the user string, so that
! it looks like address@hidden'."
! :type '(repeat (list (string :tag "Server")
(integer :tag "Port")
(string :tag "Username")
(choice (const :tag "Query when needed" nil)
! (string :tag "Password"))))
! :version "21.1"
:group 'smtpmail)
(defcustom smtpmail-starttls-credentials '(("" 25 "" ""))
--- 151,171 ----
:type 'directory
:group 'smtpmail)
! (defcustom smtpmail-auth-credentials "~/.authinfo"
! "Specify username and password for servers, directly or via .netrc file.
! This variable can either be a filename pointing to a file in netrc(5)
! format, or list of four-element lists that contain, in order,
`servername' (a string), `port' (an integer), `user' (a string) and
! `password' (a string, or nil to query the user when needed). If you
! need to enter a `realm' too, add it to the user string, so that it
! looks like address@hidden'."
! :type '(choice file
! (repeat (list (string :tag "Server")
(integer :tag "Port")
(string :tag "Username")
(choice (const :tag "Query when needed" nil)
! (string :tag "Password")))))
! :version "21.3"
:group 'smtpmail)
(defcustom smtpmail-starttls-credentials '(("" 25 "" ""))
***************
*** 464,470 ****
(defun smtpmail-try-auth-methods (process supported-extensions host port)
(let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
(mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
! (cred (smtpmail-find-credentials smtpmail-auth-credentials host port))
(passwd (when cred
(or (smtpmail-cred-passwd cred)
(read-passwd
--- 467,482 ----
(defun smtpmail-try-auth-methods (process supported-extensions host port)
(let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
(mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
! (cred (if (stringp smtpmail-auth-credentials)
! (let* ((netrc (netrc-parse smtpmail-auth-credentials))
! (hostentry (netrc-machine
! netrc host (format "%s" (or port "smtp"))
! "smtp")))
! (list host port
! (netrc-get hostentry "login")
! (netrc-get hostentry "password")))
! (smtpmail-find-credentials
! smtpmail-auth-credentials host port)))
(passwd (when cred
(or (smtpmail-cred-passwd cred)
(read-passwd
***************
*** 511,517 ****
(t
(error "Mechanism %s not implemented" mech)))
;; Remember the password.
! (unless (smtpmail-cred-passwd cred)
(setcar (cdr (cdr (cdr cred))) passwd)))))
(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)
--- 523,530 ----
(t
(error "Mechanism %s not implemented" mech)))
;; Remember the password.
! (when (and (not (stringp smtpmail-auth-credentials))
! (null (smtpmail-cred-passwd cred)))
(setcar (cdr (cdr (cdr cred))) passwd)))))
(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)