[Remail] [PATCH 2/3] Relax the mail validation so new gTLDs have a chance to pass

Andreas Rammhold andi at notmuch.email
Fri Feb 28 03:38:05 CET 2020


From: Andreas Rammhold <andreas at rammhold.de>

These days it is common to see mail addresses from the newer TLDs that
do not always fit in two to three chracters. By relaxing the requirement
from two or three characters to just two or more characters we should be
good.
---
 remail/mail.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/remail/mail.py b/remail/mail.py
index f2278dc..03a8a93 100644
--- a/remail/mail.py
+++ b/remail/mail.py
@@ -106,7 +106,7 @@ def send_mail(msg_out, account, mfrom, sender, listheaders, use_smtp):
         msg_deliver(msg_out, account, mfrom, sender, use_smtp)
 
 # 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):
     return re_mail.match(addr)
-- 
2.25.1




More information about the Remail mailing list