From 6567659206992985307ef5dd19bcbecf975634c8 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 3 Jul 2011 22:09:38 +0200 Subject: [PATCH] * mail/feedmail.el (feedmail-buffer-to-smtpmail): `smtpmail-via-smtp' now returns the error instead of nil. --- lisp/ChangeLog | 3 +++ lisp/mail/feedmail.el | 31 +++++++++++++++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ce4753cb14..481000f8851 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-07-03 Lars Magne Ingebrigtsen + * mail/feedmail.el (feedmail-buffer-to-smtpmail): + `smtpmail-via-smtp' now returns the error instead of nil. + * isearch.el (isearch-search-fun-function): Clarify the doc string (bug#8101). diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 934637ecbbd..bc9a0604279 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1633,22 +1633,21 @@ local gurus." ;; no evil. (feedmail-say-debug ">in-> feedmail-buffer-to-smtpmail %s" addr-listoid) (require 'smtpmail) - (if (not (smtpmail-via-smtp addr-listoid prepped)) - (progn - (set-buffer errors-to) - (insert "Send via smtpmail failed. Probable SMTP protocol error.\n") - (insert "Look for details below or in the *Messages* buffer.\n\n") - (let ((case-fold-search t) - ;; don't be overconfident about the name of the trace buffer - (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server)))) - (mapcar - (lambda (buffy) - (if (string-match tracer (buffer-name buffy)) - (progn - (insert "SMTP Trace from " (buffer-name buffy) "\n---------------") - (insert-buffer-substring buffy) - (insert "\n\n")))) - (buffer-list)))))) + (let ((result (smtpmail-via-smtp addr-listoid prepped))) + (when result + (set-buffer errors-to) + (insert "Send via smtpmail failed: %s" result) + (let ((case-fold-search t) + ;; don't be overconfident about the name of the trace buffer + (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server)))) + (mapcar + (lambda (buffy) + (if (string-match tracer (buffer-name buffy)) + (progn + (insert "SMTP Trace from " (buffer-name buffy) "\n---------------") + (insert-buffer-substring buffy) + (insert "\n\n")))) + (buffer-list)))))) (declare-function smtp-via-smtp "ext:smtp" (sender recipients smtp-text-buffer)) (defvar smtp-server) -- 2.39.2