From 3f354710812cbbe286f0fab4999fc06f7aa58d61 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 9 Feb 2019 14:00:24 +0100 Subject: [PATCH] [Mail] Make sending mails more robust --- site-lisp/db-mail.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/site-lisp/db-mail.el b/site-lisp/db-mail.el index e7eaa8d..5b823b2 100644 --- a/site-lisp/db-mail.el +++ b/site-lisp/db-mail.el @@ -188,10 +188,17 @@ entry of the current mail." (smtpmail-stream-type (nth 4 account)) (smtpmail-smtp-service (nth 5 account)) (smtpmail-smtp-user (nth 6 account))) + (cl-assert (cl-notany #'null (list smtpmail-smtp-server + smtpmail-stream-type + smtpmail-smtp-service + smtpmail-smtp-user)) + t + "Settings %s for sending mail are not complete for account %s." + address) (apply orig-fun args))) - (progn - (message "Sending with default account settings") - (apply orig-fun args))))) + (if (yes-or-no-p "Sending with default account settings?") + (apply orig-fun args) + (message "Sending aborted as requested by user."))))) ;; Gnus utility functions