remail: Relax the mail validation so new gTLDs have a chance to pass

These days it is common to see mail addresses from the newer TLDs that do
not always fit in two to three chracters. These are not covered by the
basic mail address validation regex.

Relax the requirement from two or three characters to just two or more
characters to covers these.

Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Andreas Rammhold 2020-03-02 17:11:37 +01:00 committed by Thomas Gleixner
parent 79d26fccfe
commit bc2b62bdda

View file

@ -106,7 +106,7 @@ def send_mail(msg_out, account, mfrom, sender, listheaders, use_smtp):
msg_deliver(msg_out, account, mfrom, sender, use_smtp) msg_deliver(msg_out, account, mfrom, sender, use_smtp)
# Minimal check for a valid email address # Minimal check for a valid email address
re_mail = re.compile('^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$') re_mail = re.compile('^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$')
def email_addr_valid(addr): def email_addr_valid(addr):
return re_mail.match(addr) return re_mail.match(addr)