1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 14:30:42 -08:00

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.
This commit is contained in:
Andreas Schwab 2023-07-28 11:53:03 +02:00
parent ea752667cd
commit 672ca232db

View file

@ -395,7 +395,7 @@ suspicious by, respectively, `textsec-local-address-suspicious-p'
and `textsec-domain-suspicious-p'."
(pcase-let ((`(,local ,domain) (split-string address "@")))
(or
(textsec-domain-suspicious-p domain)
(if domain (textsec-domain-suspicious-p domain))
(textsec-local-address-suspicious-p local))))
(defun textsec-email-address-header-suspicious-p (email)
@ -417,7 +417,7 @@ and `textsec-name-suspicious-p'."
(mail-header-parse-address email t)
(error (throw 'end "Email address can't be parsed.")))))
(or
(textsec-email-address-suspicious-p address)
(and address (textsec-email-address-suspicious-p address))
(and name (textsec-name-suspicious-p name))))))
(defun textsec-url-suspicious-p (url)