From e54751f9c96cbd9384abf3d048d11bac2c44aab5 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 25 Jan 2021 19:49:03 +0100 Subject: [PATCH] Make the email regexp less strict. The former one disallowed too many valid address, eg. those containing quotes or square brackets. --- src/utils/net.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/net.py b/src/utils/net.py index 22e7ccce7..d139b8140 100644 --- a/src/utils/net.py +++ b/src/utils/net.py @@ -40,8 +40,7 @@ import contextlib from .web import _ipAddr, _domain -emailRe = re.compile(r"^(\w&.+-]+!)*[\w&.+-]+@(%s|%s)$" % (_domain, _ipAddr), - re.I) +emailRe = re.compile(r"^\S+@(%s|%s)$" % (_domain, _ipAddr), re.I) def getAddressFromHostname(host, port=None, attempt=0): addrinfo = socket.getaddrinfo(host, port)