mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-24 02:37:05 +00:00
Fixed SIM110 (reimplemented-builtin)
This commit is contained in:
parent
99d3929f99
commit
81a4da0181
@ -231,10 +231,7 @@ def build_zone(domain, domain_properties, additional_records, env, is_zone=True)
|
|||||||
|
|
||||||
has_rec_base = list(records) # clone current state
|
has_rec_base = list(records) # clone current state
|
||||||
def has_rec(qname, rtype, prefix=None):
|
def has_rec(qname, rtype, prefix=None):
|
||||||
for rec in has_rec_base:
|
return any(rec[0] == qname and rec[1] == rtype and (prefix is None or rec[2].startswith(prefix)) for rec in has_rec_base)
|
||||||
if rec[0] == qname and rec[1] == rtype and (prefix is None or rec[2].startswith(prefix)):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
# The user may set other records that don't conflict with our settings.
|
# The user may set other records that don't conflict with our settings.
|
||||||
# Don't put any TXT records above this line, or it'll prevent any custom TXT records.
|
# Don't put any TXT records above this line, or it'll prevent any custom TXT records.
|
||||||
|
@ -86,10 +86,7 @@ def prettify_idn_email_address(email):
|
|||||||
|
|
||||||
def is_dcv_address(email):
|
def is_dcv_address(email):
|
||||||
email = email.lower()
|
email = email.lower()
|
||||||
for localpart in ("admin", "administrator", "postmaster", "hostmaster", "webmaster", "abuse"):
|
return any(email.startswith((localpart + "@", localpart + "+")) for localpart in ("admin", "administrator", "postmaster", "hostmaster", "webmaster", "abuse"))
|
||||||
if email.startswith((localpart + "@", localpart + "+")):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def open_database(env, with_connection=False):
|
def open_database(env, with_connection=False):
|
||||||
conn = sqlite3.connect(env["STORAGE_ROOT"] + "/mail/users.sqlite")
|
conn = sqlite3.connect(env["STORAGE_ROOT"] + "/mail/users.sqlite")
|
||||||
|
Loading…
Reference in New Issue
Block a user