aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2023-07-28 11:53:03 +0200
committerAndreas Schwab2024-05-04 21:08:43 +0200
commit672ca232db0a30e45b7f3f5e06b8fc6f12e23faa (patch)
treeb1bb86e67c8138d19e42f0596e93dbaebd749735
parentea752667cd8a146e79e5646bbedc76be08c50141 (diff)
downloademacs-672ca232db0a30e45b7f3f5e06b8fc6f12e23faa.tar.gz
emacs-672ca232db0a30e45b7f3f5e06b8fc6f12e23faa.zip
textsec: handle email address without domain part
* lisp/international/textsec.el (textsec-email-address-suspicious-p): Handle missing domain part. (textsec-email-address-header-suspicious-p): Likewise.
-rw-r--r--lisp/international/textsec.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/international/textsec.el b/lisp/international/textsec.el
index 86429f15f7c..ce1f6c1d592 100644
--- a/lisp/international/textsec.el
+++ b/lisp/international/textsec.el
@@ -395,7 +395,7 @@ suspicious by, respectively, `textsec-local-address-suspicious-p'
395and `textsec-domain-suspicious-p'." 395and `textsec-domain-suspicious-p'."
396 (pcase-let ((`(,local ,domain) (split-string address "@"))) 396 (pcase-let ((`(,local ,domain) (split-string address "@")))
397 (or 397 (or
398 (textsec-domain-suspicious-p domain) 398 (if domain (textsec-domain-suspicious-p domain))
399 (textsec-local-address-suspicious-p local)))) 399 (textsec-local-address-suspicious-p local))))
400 400
401(defun textsec-email-address-header-suspicious-p (email) 401(defun textsec-email-address-header-suspicious-p (email)
@@ -417,7 +417,7 @@ and `textsec-name-suspicious-p'."
417 (mail-header-parse-address email t) 417 (mail-header-parse-address email t)
418 (error (throw 'end "Email address can't be parsed."))))) 418 (error (throw 'end "Email address can't be parsed.")))))
419 (or 419 (or
420 (textsec-email-address-suspicious-p address) 420 (and address (textsec-email-address-suspicious-p address))
421 (and name (textsec-name-suspicious-p name)))))) 421 (and name (textsec-name-suspicious-p name))))))
422 422
423(defun textsec-url-suspicious-p (url) 423(defun textsec-url-suspicious-p (url)