mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 20:38:05 +00:00
config: only block words if they are in privacy* config keys
This commit is contained in:
@@ -426,8 +426,9 @@ def check_config(config):
|
|||||||
mail_domain = config.mail_domain
|
mail_domain = config.mail_domain
|
||||||
if mail_domain != "testrun.org" and not mail_domain.endswith(".testrun.org"):
|
if mail_domain != "testrun.org" and not mail_domain.endswith(".testrun.org"):
|
||||||
blocked_words = "merlinux schmieder testrun.org".split()
|
blocked_words = "merlinux schmieder testrun.org".split()
|
||||||
for value in config.__dict__.values():
|
for key in config.__dict__:
|
||||||
if any(x in str(value) for x in blocked_words):
|
value = config.__dict__[key]
|
||||||
|
if key.startswith("privacy") and any(x in str(value) for x in blocked_words):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"please set your own privacy contacts/addresses in {config._inipath}"
|
f"please set your own privacy contacts/addresses in {config._inipath}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user