Configure outgoing panel email for linked mail deployments
This commit is contained in:
1 parent
d6fc3b8455
commit
63efb9f204
24 files changed
+723
-29
No files matched your search
@@ -21,8 +21,10 @@ from .config import (
|
||||
keys,
|
||||
parse_plan,
|
||||
read_password,
|
||||
read_smtp_password,
|
||||
read_ssh_host_key,
|
||||
role,
|
||||
smtp_credential,
|
||||
)
|
||||
|
||||
STATE = Path("/var/lib/coulobre-cluster")
|
||||
@@ -63,6 +65,10 @@ class Cluster:
|
||||
yield (
|
||||
f" DNS {panel.plan.dns.mode} · Mail {panel.plan.mail.mode}"
|
||||
)
|
||||
if relay := panel.plan.smtp:
|
||||
yield f" Panel SMTP: {relay.host}:{relay.port}"
|
||||
elif panel.plan.mail.mode == "remote":
|
||||
yield " Panel SMTP: configure after installation"
|
||||
if panel.domains:
|
||||
yield " Domain scope: " + ", ".join(panel.domains)
|
||||
for name, receiver in self.receivers.items():
|
||||
@@ -107,7 +113,7 @@ def parse_cluster(data):
|
||||
def parse_panel(entry, index, receivers, sending):
|
||||
keys(
|
||||
entry,
|
||||
{"name", "panel", "admin", "hosting", "dns", "ssh", "domains"},
|
||||
{"name", "panel", "admin", "hosting", "dns", "ssh", "domains", "smtp"},
|
||||
"cluster panel",
|
||||
)
|
||||
name = entry.get("name", "")
|
||||
@@ -141,6 +147,8 @@ def parse_panel(entry, index, receivers, sending):
|
||||
"dns": {"mode": dns},
|
||||
"mail": {"mode": "off"},
|
||||
}
|
||||
if "smtp" in entry:
|
||||
params["smtp"] = entry["smtp"]
|
||||
pins = {}
|
||||
for service, receiver in receivers.items():
|
||||
if service == "dns" and dns != "shared":
|
||||
@@ -279,6 +287,11 @@ def run_remote_step(settings):
|
||||
if action == "cluster-keys"
|
||||
else print,
|
||||
scopes=settings["scopes"],
|
||||
smtp_password=(
|
||||
smtp_credential(settings.get("smtp_password"))
|
||||
if plan.smtp and action == "cluster-panel"
|
||||
else None
|
||||
),
|
||||
)
|
||||
remote.check_panel_destination()
|
||||
installer.check_state()
|
||||
@@ -352,6 +365,9 @@ class ClusterInstaller:
|
||||
}
|
||||
|
||||
def check(self):
|
||||
for panel in self.cluster.panels:
|
||||
if panel.plan.smtp:
|
||||
read_smtp_password(panel.plan.smtp.password_file)
|
||||
self.progress("Checking the local panel.")
|
||||
self.local.check_state()
|
||||
remote.check_panel_destination()
|
||||
@@ -501,7 +517,16 @@ class ClusterInstaller:
|
||||
| {
|
||||
"role": "cluster-panel",
|
||||
"password": self.passwords[panel.name],
|
||||
},
|
||||
}
|
||||
| (
|
||||
{
|
||||
"smtp_password": read_smtp_password(
|
||||
panel.plan.smtp.password_file
|
||||
)
|
||||
}
|
||||
if panel.plan.smtp
|
||||
else {}
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user