Function: textsec-email-address-header-suspicious-p
textsec-email-address-header-suspicious-p is a byte-compiled function
defined in textsec.el.gz.
Signature
(textsec-email-address-header-suspicious-p EMAIL)
Documentation
Say whether EMAIL address specification looks suspicious.
If it isn't, return nil. If it is, return a string explaining the potential problem.
Note that EMAIL has to be a valid email specification according to RFC2047bis -- strings that can't be parsed will be flagged as suspicious.
An email specification is considered suspicious if either of its
two parts -- the address or the name -- are found to be
suspicious by, respectively, textsec-email-address-suspicious-p
and textsec-name-suspicious-p.
Source Code
;; Defined in /usr/src/emacs/lisp/international/textsec.el.gz
(defun textsec-email-address-header-suspicious-p (email)
"Say whether EMAIL address specification looks suspicious.
If it isn't, return nil. If it is, return a string explaining the
potential problem.
Note that EMAIL has to be a valid email specification according
to RFC2047bis -- strings that can't be parsed will be flagged as
suspicious.
An email specification is considered suspicious if either of its
two parts -- the address or the name -- are found to be
suspicious by, respectively, `textsec-email-address-suspicious-p'
and `textsec-name-suspicious-p'."
(catch 'end
(pcase-let ((`(,address . ,name)
(condition-case nil
(mail-header-parse-address email t)
(error (throw 'end "Email address can't be parsed.")))))
(or
(and address (textsec-email-address-suspicious-p address))
(and name (textsec-name-suspicious-p name))))))