mirror of
https://github.com/chatmail/relay.git
synced 2026-05-17 09:18:57 +00:00
feat!: ignore passthrough_sender and passthrough_recipients to eliminate one more source of unencrypted messages
When running "cmdeploy run" operators will see a warning if their chatmail.ini contains these unused options.
This commit is contained in:
@@ -41,8 +41,8 @@ class Config:
|
||||
self.username_min_length = int(params.get("username_min_length", 9))
|
||||
self.username_max_length = int(params.get("username_max_length", 9))
|
||||
self.password_min_length = int(params.get("password_min_length", 9))
|
||||
self.passthrough_senders = params.get("passthrough_senders", "").split()
|
||||
self.passthrough_recipients = params.get("passthrough_recipients", "").split()
|
||||
_unused = ("passthrough_senders", "passthrough_recipients")
|
||||
self.unused_keys = [k for k in _unused if params.get(k)]
|
||||
self.www_folder = params.get("www_folder", "")
|
||||
self.filtermail_smtp_port = int(params.get("filtermail_smtp_port", "10080"))
|
||||
self.filtermail_smtp_port_incoming = int(
|
||||
|
||||
@@ -42,13 +42,6 @@ mail_domain = {mail_domain}
|
||||
# minimum length a password must have
|
||||
#password_min_length = 9
|
||||
|
||||
# list of chatmail addresses which can send outbound un-encrypted mail
|
||||
#passthrough_senders =
|
||||
|
||||
# list of e-mail recipients for which to accept outbound un-encrypted mails
|
||||
# (space-separated, item may start with "@" to whitelist whole recipient domains)
|
||||
#passthrough_recipients =
|
||||
|
||||
# Use externally managed TLS certificates instead of built-in acmetool.
|
||||
# Paths refer to files on the deployment server (not the build machine).
|
||||
# Both files must already exist before running cmdeploy.
|
||||
|
||||
@@ -45,8 +45,12 @@ def test_read_config_basic_using_defaults(tmp_path, maildomain):
|
||||
assert example_config.username_min_length == 9
|
||||
assert example_config.username_max_length == 9
|
||||
assert example_config.password_min_length == 9
|
||||
assert example_config.passthrough_recipients == []
|
||||
assert example_config.passthrough_senders == []
|
||||
assert example_config.unused_keys == []
|
||||
|
||||
|
||||
def test_config_unused_keys(make_config):
|
||||
config = make_config("chat.example.org", {"passthrough_senders": "x@y.org"})
|
||||
assert config.unused_keys == ["passthrough_senders"]
|
||||
|
||||
|
||||
def test_config_userstate_paths(make_config, tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user