Commit a8ba4429 authored by Sam Steingold's avatar Sam Steingold
Browse files

(smtpmail-try-auth-methods): host is not in the authinfo/netrc => cred=nil.

parent 56a0382c
2002-04-26 Sam Steingold <sds@gnu.org>
* mail/smtpmail.el (smtpmail-try-auth-methods): When `host' is
not in the authinfo/netrc, keep `cred' at nil.
2002-04-26 Gerd Moellmann <gerd@gnu.org> 2002-04-26 Gerd Moellmann <gerd@gnu.org>
* find-file.el: Remove Ada-specific example code. * find-file.el: Remove Ada-specific example code.
2002-04-25 Michael Kifer <kifer@cs.stonybrook.edu> 2002-04-25 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff-hooks.el: Put back the autoloads. * ediff-hooks.el: Put back the autoloads.
2002-04-25 Colin Walters <walters@verbum.org> 2002-04-25 Colin Walters <walters@verbum.org>
* ibuffer.el (define column process): Use `ibuffer-aif'. * ibuffer.el (define column process): Use `ibuffer-aif'.
...@@ -147,7 +152,7 @@ ...@@ -147,7 +152,7 @@
`save-selected-window'. `save-selected-window'.
(ibuffer-mode): Make `ibuffer-filtering-groups' and (ibuffer-mode): Make `ibuffer-filtering-groups' and
`ibuffer-hidden-filtering-groups' buffer-local. `ibuffer-hidden-filtering-groups' buffer-local.
* ibuf-macs.el (ibuffer-save-marks): Call * ibuf-macs.el (ibuffer-save-marks): Call
`ibuffer-redisplay-engine'. `ibuffer-redisplay-engine'.
...@@ -164,7 +169,7 @@ ...@@ -164,7 +169,7 @@
2002-04-24 Eli Zaretskii <eliz@is.elta.co.il> 2002-04-24 Eli Zaretskii <eliz@is.elta.co.il>
* menu-bar.el (menu-bar-adv-search-menu) * menu-bar.el (menu-bar-adv-search-menu)
(menu-bar-adv-search-menu): Improve the help text. (menu-bar-adv-search-menu): Improve the help text.
2002-04-24 Simon Josefsson <jas@extundo.com> 2002-04-24 Simon Josefsson <jas@extundo.com>
...@@ -179,7 +184,7 @@ ...@@ -179,7 +184,7 @@
2002-04-24 Miles Bader <miles@gnu.org> 2002-04-24 Miles Bader <miles@gnu.org>
* menu-bar.el (buffers-menu-show-directories) * menu-bar.el (buffers-menu-show-directories)
(buffers-menu-show-status): New variables. (buffers-menu-show-status): New variables.
(menu-bar-update-buffers-1): Use them. (menu-bar-update-buffers-1): Use them.
...@@ -219,9 +224,9 @@ ...@@ -219,9 +224,9 @@
(occur-fontify-on-property): New function. (occur-fontify-on-property): New function.
(occur-fontify-region-function, occur-unfontify-region-function): (occur-fontify-region-function, occur-unfontify-region-function):
New functions. New functions.
* ibuffer.el (ibuffer-accumulate-lines): Moved to replace.el. * ibuffer.el (ibuffer-accumulate-lines): Moved to replace.el.
* ibuf-ext.el (ibuffer-depropertize-string): Delete. * ibuf-ext.el (ibuffer-depropertize-string): Delete.
(ibuffer-occur-match-face): Delete. (ibuffer-occur-match-face): Delete.
(ibuffer-occur-props, ibuffer-occur-mode): Delete. (ibuffer-occur-props, ibuffer-occur-mode): Delete.
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
;;(setq smtpmail-starttls-credentials ;;(setq smtpmail-starttls-credentials
;; '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert"))) ;; '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert")))
;; To queue mail, set smtpmail-queue-mail to t and use ;; To queue mail, set smtpmail-queue-mail to t and use
;; smtpmail-send-queued-mail to send. ;; smtpmail-send-queued-mail to send.
;; Modified by Stephen Cranefield <scranefield@infoscience.otago.ac.nz>, ;; Modified by Stephen Cranefield <scranefield@infoscience.otago.ac.nz>,
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
:type '(choice (const nil) string) :type '(choice (const nil) string)
:group 'smtpmail) :group 'smtpmail)
(defcustom smtpmail-smtp-server (defcustom smtpmail-smtp-server
(or (getenv "SMTPSERVER") smtpmail-default-smtp-server) (or (getenv "SMTPSERVER") smtpmail-default-smtp-server)
"*The name of the host running SMTP server." "*The name of the host running SMTP server."
:type '(choice (const nil) string) :type '(choice (const nil) string)
...@@ -139,7 +139,7 @@ The commands enables verbose information from the SMTP server." ...@@ -139,7 +139,7 @@ The commands enables verbose information from the SMTP server."
:type 'boolean :type 'boolean
:group 'smtpmail) :group 'smtpmail)
(defcustom smtpmail-queue-mail nil (defcustom smtpmail-queue-mail nil
"*Specify if mail is queued (if t) or sent immediately (if nil). "*Specify if mail is queued (if t) or sent immediately (if nil).
If queued, it is stored in the directory `smtpmail-queue-dir' If queued, it is stored in the directory `smtpmail-queue-dir'
and sent with `smtpmail-send-queued-mail'." and sent with `smtpmail-send-queued-mail'."
...@@ -292,7 +292,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -292,7 +292,7 @@ This is relative to `smtpmail-queue-dir'.")
;; ... then undo escaping of matching parentheses, ;; ... then undo escaping of matching parentheses,
;; including matching nested parentheses. ;; including matching nested parentheses.
(goto-char fullname-start) (goto-char fullname-start)
(while (re-search-forward (while (re-search-forward
"\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)" "\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)"
fullname-end 1) fullname-end 1)
(replace-match "\\1(\\3)" t) (replace-match "\\1(\\3)" t)
...@@ -327,16 +327,16 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -327,16 +327,16 @@ This is relative to `smtpmail-queue-dir'.")
(setq smtpmail-recipient-address-list (setq smtpmail-recipient-address-list
(smtpmail-deduce-address-list tembuf (point-min) delimline)) (smtpmail-deduce-address-list tembuf (point-min) delimline))
(kill-buffer smtpmail-address-buffer) (kill-buffer smtpmail-address-buffer)
(smtpmail-do-bcc delimline) (smtpmail-do-bcc delimline)
; Send or queue ; Send or queue
(if (not smtpmail-queue-mail) (if (not smtpmail-queue-mail)
(if (not (null smtpmail-recipient-address-list)) (if (not (null smtpmail-recipient-address-list))
(if (not (smtpmail-via-smtp (if (not (smtpmail-via-smtp
smtpmail-recipient-address-list tembuf)) smtpmail-recipient-address-list tembuf))
(error "Sending failed; SMTP protocol error")) (error "Sending failed; SMTP protocol error"))
(error "Sending failed; no recipients")) (error "Sending failed; no recipients"))
(let* ((file-data (concat (let* ((file-data (concat
smtpmail-queue-dir smtpmail-queue-dir
(concat (time-stamp-yyyy-mm-dd) (concat (time-stamp-yyyy-mm-dd)
"_" (time-stamp-hh:mm:ss) "_" (time-stamp-hh:mm:ss)
...@@ -356,12 +356,12 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -356,12 +356,12 @@ This is relative to `smtpmail-queue-dir'.")
(insert (concat (insert (concat
"(setq smtpmail-recipient-address-list '" "(setq smtpmail-recipient-address-list '"
(prin1-to-string smtpmail-recipient-address-list) (prin1-to-string smtpmail-recipient-address-list)
")\n")) ")\n"))
(write-file file-elisp) (write-file file-elisp)
(set-buffer (generate-new-buffer buffer-scratch)) (set-buffer (generate-new-buffer buffer-scratch))
(insert (concat file-data "\n")) (insert (concat file-data "\n"))
(append-to-file (point-min) (append-to-file (point-min)
(point-max) (point-max)
smtpmail-queue-index) smtpmail-queue-index)
) )
(kill-buffer buffer-scratch) (kill-buffer buffer-scratch)
...@@ -469,12 +469,13 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -469,12 +469,13 @@ This is relative to `smtpmail-queue-dir'.")
(mech (car (smtpmail-intersection smtpmail-auth-supported mechs))) (mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
(cred (if (stringp smtpmail-auth-credentials) (cred (if (stringp smtpmail-auth-credentials)
(let* ((netrc (netrc-parse smtpmail-auth-credentials)) (let* ((netrc (netrc-parse smtpmail-auth-credentials))
(hostentry (netrc-machine (hostentry (netrc-machine
netrc host (format "%s" (or port "smtp")) netrc host (format "%s" (or port "smtp"))
"smtp"))) "smtp")))
(list host port (when hostentry
(netrc-get hostentry "login") (list host port
(netrc-get hostentry "password"))) (netrc-get hostentry "login")
(netrc-get hostentry "password"))))
(smtpmail-find-credentials (smtpmail-find-credentials
smtpmail-auth-credentials host port))) smtpmail-auth-credentials host port)))
(passwd (when cred (passwd (when cred
...@@ -521,7 +522,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -521,7 +522,7 @@ This is relative to `smtpmail-queue-dir'.")
(>= (car ret) 400)) (>= (car ret) 400))
(throw 'done nil))) (throw 'done nil)))
(t (t
(error "Mechanism %s not implemented" mech))) (error "Mechanism %s not implemented" mech)))
;; Remember the password. ;; Remember the password.
(when (and (not (stringp smtpmail-auth-credentials)) (when (and (not (stringp smtpmail-auth-credentials))
(null (smtpmail-cred-passwd cred))) (null (smtpmail-cred-passwd cred)))
...@@ -558,7 +559,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -558,7 +559,7 @@ This is relative to `smtpmail-queue-dir'.")
(make-local-variable 'smtpmail-read-point) (make-local-variable 'smtpmail-read-point)
(setq smtpmail-read-point (point-min)) (setq smtpmail-read-point (point-min))
(if (or (null (car (setq greeting (smtpmail-read-response process)))) (if (or (null (car (setq greeting (smtpmail-read-response process))))
(not (integerp (car greeting))) (not (integerp (car greeting)))
(>= (car greeting) 400)) (>= (car greeting) 400))
...@@ -615,7 +616,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -615,7 +616,7 @@ This is relative to `smtpmail-queue-dir'.")
(starttls-negotiate process) (starttls-negotiate process)
(setq do-starttls nil)) (setq do-starttls nil))
(setq do-ehlo nil)))) (setq do-ehlo nil))))
(smtpmail-try-auth-methods process supported-extensions host port) (smtpmail-try-auth-methods process supported-extensions host port)
(if (or (member 'onex supported-extensions) (if (or (member 'onex supported-extensions)
...@@ -691,7 +692,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -691,7 +692,7 @@ This is relative to `smtpmail-queue-dir'.")
(>= (car response-code) 400)) (>= (car response-code) 400))
(throw 'done nil) (throw 'done nil)
)) ))
;; RCPT TO: <recipient> ;; RCPT TO: <recipient>
(let ((n 0)) (let ((n 0))
(while (not (null (nth n recipient))) (while (not (null (nth n recipient)))
...@@ -705,7 +706,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -705,7 +706,7 @@ This is relative to `smtpmail-queue-dir'.")
(throw 'done nil) (throw 'done nil)
) )
)) ))
;; DATA ;; DATA
(smtpmail-send-command process "DATA") (smtpmail-send-command process "DATA")
...@@ -767,7 +768,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -767,7 +768,7 @@ This is relative to `smtpmail-queue-dir'.")
(setq response-strings (setq response-strings
(cons (buffer-substring smtpmail-read-point (- match-end 2)) (cons (buffer-substring smtpmail-read-point (- match-end 2))
response-strings)) response-strings))
(goto-char smtpmail-read-point) (goto-char smtpmail-read-point)
(if (looking-at "[0-9]+ ") (if (looking-at "[0-9]+ ")
(let ((begin (match-beginning 0)) (let ((begin (match-beginning 0))
...@@ -782,10 +783,10 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -782,10 +783,10 @@ This is relative to `smtpmail-queue-dir'.")
nil nil
(setq response-continue nil) (setq response-continue nil)
(setq return-value (setq return-value
(cons (string-to-int (cons (string-to-int
(buffer-substring begin end)) (buffer-substring begin end))
(nreverse response-strings))))) (nreverse response-strings)))))
(if (looking-at "[0-9]+-") (if (looking-at "[0-9]+-")
(progn (if smtpmail-debug-info (progn (if smtpmail-debug-info
(message "%s" (car response-strings))) (message "%s" (car response-strings)))
...@@ -794,7 +795,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -794,7 +795,7 @@ This is relative to `smtpmail-queue-dir'.")
(progn (progn
(setq smtpmail-read-point match-end) (setq smtpmail-read-point match-end)
(setq response-continue nil) (setq response-continue nil)
(setq return-value (setq return-value
(cons nil (nreverse response-strings))) (cons nil (nreverse response-strings)))
) )
))) )))
...@@ -818,7 +819,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -818,7 +819,7 @@ This is relative to `smtpmail-queue-dir'.")
smtpmail-code-conv-from) smtpmail-code-conv-from)
(setq data (string-as-multibyte (setq data (string-as-multibyte
(encode-coding-string data smtpmail-code-conv-from)))) (encode-coding-string data smtpmail-code-conv-from))))
(if smtpmail-debug-info (if smtpmail-debug-info
(insert data "\r\n")) (insert data "\r\n"))
...@@ -855,7 +856,7 @@ This is relative to `smtpmail-queue-dir'.") ...@@ -855,7 +856,7 @@ This is relative to `smtpmail-queue-dir'.")
) )
) )
) )
(defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end) (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end)
"Get address list suitable for smtp RCPT TO: <address>." "Get address list suitable for smtp RCPT TO: <address>."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment