1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-16 10:59:53 +02:00

fix warnings

(cherry picked from commit 2b6daf6157)
This commit is contained in:
Florent Daigniere 2024-06-19 14:37:26 +02:00 committed by Mergify
parent 0320ddeb72
commit 59bcf25b5b
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ def postfix_dane_map(domain_name):
@internal.route("/postfix/domain/<domain_name>") @internal.route("/postfix/domain/<domain_name>")
def postfix_mailbox_domain(domain_name): def postfix_mailbox_domain(domain_name):
if re.match("^\[.*\]$", domain_name): if re.match(r'^\[.*\]$', domain_name):
return flask.abort(404) return flask.abort(404)
domain = models.Domain.query.get(domain_name) or \ domain = models.Domain.query.get(domain_name) or \
models.Alternative.query.get(domain_name) or \ models.Alternative.query.get(domain_name) or \
@ -39,7 +39,7 @@ def postfix_alias_map(alias):
@internal.route("/postfix/transport/<path:email>") @internal.route("/postfix/transport/<path:email>")
def postfix_transport(email): def postfix_transport(email):
if email == '*' or re.match("(^|.*@)\[.*\]$", email): if email == '*' or re.match(r'(^|.*@)\[.*\]$', email):
return flask.abort(404) return flask.abort(404)
_, domain_name = models.Email.resolve_domain(email) _, domain_name = models.Email.resolve_domain(email)
relay = models.Relay.query.get(domain_name) or flask.abort(404) relay = models.Relay.query.get(domain_name) or flask.abort(404)

View File

@ -7,7 +7,7 @@ import flask_wtf
import re import re
import ipaddress import ipaddress
LOCALPART_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*$" LOCALPART_REGEX = r'^[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*$'
class DestinationField(fields.SelectMultipleField): class DestinationField(fields.SelectMultipleField):
""" Allow for multiple emails selection from current user choices and """ Allow for multiple emails selection from current user choices and