From: Lars Ingebrigtsen Date: Wed, 19 Jan 2022 18:00:13 +0000 (+0100) Subject: Make Message check for invalid recipients before sending X-Git-Tag: emacs-29.0.90~2931 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ec0abf37eeb4d8382f8035c78d3bb8c328f5dfa8;p=emacs.git Make Message check for invalid recipients before sending * lisp/gnus/message.el (message-check-recipients): Check for suspicious addresses before sending (bug#51733). --- diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 8f11e538c5a..1f47e696c30 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4663,6 +4663,12 @@ This function could be useful in `message-setup-hook'." (format "Email address %s looks invalid; send anyway?" address)) (user-error "Invalid address %s" address)))) + ;; Then check for suspicious addresses. + (dolist (address (mail-header-parse-addresses addr t)) + (when-let ((warning (textsec-check address 'email-address-header))) + (unless (y-or-n-p + (format "Suspicious address: %s; send anyway?" warning)) + (user-error "Suspicious address %s" address)))) ;; Then check for likely-bogus addresses. (dolist (bog (message-bogus-recipient-p addr)) (and bog