Subject: bug#51733: 27.1; Detect impossible email addresses better

From: Michael Albinus <[email-masked]>
Date: Wed, 19 Jan 2022 13:49:56 +0100

Eli Zaretskii <[email-masked]> writes:

Hi Eli,

>> I think the places it would make sense to hook this machinery in would
>> be in:
>>
>> * shr (displaying URLs and links)
>> * Gnus/rmail (displaying email addresses)
>> * Message (when responding to mail; a prompt "do you really?")
>> * browse-url (prompt)
>
> Sounds reasonable.
>
> Perhaps also Tramp (host names)?

--8<---------------cut here---------------start------------->8---
(defconst tramp-host-regexp "[[:alnum:]_.%-]+"
  "Regexp matching host names.")

;; The following regexp is a bit sloppy.  But it shall serve our
;; purposes.  It covers also IPv4 mapped IPv6 addresses, like in
;; "::ffff:192.168.0.1".
(defconst tramp-ipv6-regexp "\\(?:[[:alnum:]]*:\\)+[[:alnum:].]+"
  "Regexp matching IPv6 addresses.")
--8<---------------cut here---------------end--------------->8---

This should be sufficient, shouldn't it?

Best regards, Michael.