Commit ff7560b6 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Make Message warn about invalid addresses

* lisp/gnus/message.el (message-check-recipients): Warn about
invalid email addresses (bug#32639).
parent a5eae3d1
Pipeline #3264 failed with stage
in 66 minutes
......@@ -4364,6 +4364,14 @@ This function could be useful in `message-setup-hook'."
(dolist (hdr '("To" "Cc" "Bcc"))
(let ((addr (message-fetch-field hdr)))
(when (stringp addr)
;; First check for syntactically invalid addresses.
(dolist (address (mail-header-parse-addresses addr t))
(unless (mail-header-parse-addresses address)
(unless (y-or-n-p
(format "Email address %s looks invalid; send anyway?"
address))
(user-error "Invalid address %s" address))))
;; Then check for likely-bogus addresses.
(dolist (bog (message-bogus-recipient-p addr))
(and bog
(not (y-or-n-p
......
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