emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master ce63f91025: Add textsec functions for verifying email address


From: Robert Pluim
Subject: Re: master ce63f91025: Add textsec functions for verifying email addresses
Date: Tue, 18 Jan 2022 14:38:05 +0100

>>>>> On Tue, 18 Jan 2022 07:20:12 -0500 (EST), Lars Ingebrigtsen 
>>>>> <larsi@gnus.org> said:
    Lars> +(defun textsec-email-suspicious-p (email)
    Lars> +  "Say whether EMAIL looks suspicious.
    Lars> +If it isn't, nil is returned.  If it is, a string explaining the
    Lars> +problem is returned."
    Lars> +  (pcase-let* ((`(,address . ,name) (mail-header-parse-address email 
t))
    Lars> +               (`(,local ,domain) (split-string address "@")))
    Lars> +    (or
    Lars> +     (textsec-domain-suspicious-p domain)
    Lars> +     (textsec-local-address-suspicious-p local)
    Lars> +     (textsec-name-suspicious-p name))))
    Lars> +
    Lars>  (provide 'textsec)

Does it really matter if the display name of an email address has
possibly confusable characters in it? Itʼs not actually used for
anything except to be displayed to the user.

(as an aside:

(mail-header-parse-address "Robert Pluim rpluim@gmail.com")
=>
("RobertPluimrpluim@gmail.com")

I know thatʼs not a valid format, but the behaviour is somewhat
surprising)

Robert
-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]