Make the email regexp less strict.

The former one disallowed too many valid address, eg. those containing
quotes or square brackets.
This commit is contained in:
Valentin Lorentz 2021-01-25 19:49:03 +01:00
parent 7110b8f74e
commit e54751f9c9

View File

@ -40,8 +40,7 @@ import contextlib
from .web import _ipAddr, _domain from .web import _ipAddr, _domain
emailRe = re.compile(r"^(\w&.+-]+!)*[\w&.+-]+@(%s|%s)$" % (_domain, _ipAddr), emailRe = re.compile(r"^\S+@(%s|%s)$" % (_domain, _ipAddr), re.I)
re.I)
def getAddressFromHostname(host, port=None, attempt=0): def getAddressFromHostname(host, port=None, attempt=0):
addrinfo = socket.getaddrinfo(host, port) addrinfo = socket.getaddrinfo(host, port)