aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mail
diff options
context:
space:
mode:
authorGlenn Morris2018-10-23 09:39:11 -0700
committerGlenn Morris2018-10-23 09:39:11 -0700
commit5aa41f775e1e69dba7c6f2b2a8d0334ca9c2cfdb (patch)
treec0bff44180b6b35e3d690a1a385d006ea8ba8adb /lisp/mail
parent5c5bed72a6b2963a28443f70c8c5c8e510b81f26 (diff)
parent2efd40076c8977aaf54d7478db96e5dbf623f37d (diff)
downloademacs-5aa41f775e1e69dba7c6f2b2a8d0334ca9c2cfdb.tar.gz
emacs-5aa41f775e1e69dba7c6f2b2a8d0334ca9c2cfdb.zip
Merge from origin/emacs-26
2efd400 (origin/emacs-26) Correct typo in GNU ELPA url 6239016 * doc/misc/dired-x.texi (Omitting Variables): Fix wording. (B... 1531bca Fix help-form binding in dired-create-files cf79327 Fix a pasto in a Gnus doc string a4e40f6 ; * doc/emacs/files.texi (Reverting): Improve wording in last... f632ecb Update revert-buffer documentation eb67689 * lisp/mail/smtpmail.el (smtpmail-send-queued-mail): Load fil... 433e364 ; * etc/NEWS: Announce that emacs-module.h is now installed. # Conflicts: # lisp/mail/smtpmail.el
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/smtpmail.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 9b045b25584..8a1e86b7750 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -397,35 +397,35 @@ for `smtpmail-try-auth-method'.")
397 (with-temp-buffer 397 (with-temp-buffer
398 ;; Get index, get first mail, send it, update index, get second 398 ;; Get index, get first mail, send it, update index, get second
399 ;; mail, send it, etc... 399 ;; mail, send it, etc...
400 (let ((file-msg "") 400 (let (file-data file-elisp
401 (qfile (expand-file-name smtpmail-queue-index-file 401 (qfile (expand-file-name smtpmail-queue-index-file
402 smtpmail-queue-dir)) 402 smtpmail-queue-dir))
403 result) 403 result)
404 (insert-file-contents qfile) 404 (insert-file-contents qfile)
405 (goto-char (point-min)) 405 (goto-char (point-min))
406 (while (not (eobp)) 406 (while (not (eobp))
407 (setq file-msg (buffer-substring (point) (line-end-position))) 407 (setq file-data (buffer-substring (point) (line-end-position)))
408 (setq file-elisp (concat file-data ".el"))
408 ;; FIXME: Avoid `load' which can execute arbitrary code and is hence 409 ;; FIXME: Avoid `load' which can execute arbitrary code and is hence
409 ;; a source of security holes. Better read the file and extract the 410 ;; a source of security holes. Better read the file and extract the
410 ;; data "by hand". 411 ;; data "by hand".
411 ;;(load file-msg) 412 ;;(load file-elisp)
412 (with-temp-buffer 413 (with-temp-buffer
413 (insert-file-contents (concat file-msg ".el")) 414 (insert-file-contents file-elisp)
414 (goto-char (point-min)) 415 (goto-char (point-min))
415 (pcase (read (current-buffer)) 416 (pcase (read (current-buffer))
416 (`(setq smtpmail-recipient-address-list ',v) 417 (`(setq smtpmail-recipient-address-list ',v)
417 (skip-chars-forward " \n\t") 418 (skip-chars-forward " \n\t")
418 (unless (eobp) (message "Ignoring trailing text in %S" 419 (unless (eobp) (message "Ignoring trailing text in %S"
419 (concat file-msg ".el"))) 420 file-elisp))
420 (setq smtpmail-recipient-address-list v)) 421 (setq smtpmail-recipient-address-list v))
421 (sexp (error "Unexpected code in %S: %S" 422 (sexp (error "Unexpected code in %S: %S" file-elisp sexp))))
422 (concat file-msg ".el") sexp))))
423 ;; Insert the message literally: it is already encoded as per 423 ;; Insert the message literally: it is already encoded as per
424 ;; the MIME headers, and code conversions might guess the 424 ;; the MIME headers, and code conversions might guess the
425 ;; encoding wrongly. 425 ;; encoding wrongly.
426 (with-temp-buffer 426 (with-temp-buffer
427 (let ((coding-system-for-read 'no-conversion)) 427 (let ((coding-system-for-read 'no-conversion))
428 (insert-file-contents file-msg)) 428 (insert-file-contents file-data))
429 (let ((smtpmail-mail-address 429 (let ((smtpmail-mail-address
430 (or (and mail-specify-envelope-from (mail-envelope-from)) 430 (or (and mail-specify-envelope-from (mail-envelope-from))
431 user-mail-address))) 431 user-mail-address)))
@@ -435,8 +435,8 @@ for `smtpmail-try-auth-method'.")
435 (current-buffer))) 435 (current-buffer)))
436 (error "Sending failed: %s" result)) 436 (error "Sending failed: %s" result))
437 (error "Sending failed; no recipients")))) 437 (error "Sending failed; no recipients"))))
438 (delete-file file-msg) 438 (delete-file file-data)
439 (delete-file (concat file-msg ".el")) 439 (delete-file file-elisp)
440 (delete-region (point-at-bol) (point-at-bol 2))) 440 (delete-region (point-at-bol) (point-at-bol 2)))
441 (write-region (point-min) (point-max) qfile)))) 441 (write-region (point-min) (point-max) qfile))))
442 442