mirror of
https://github.com/chatmail/relay.git
synced 2026-06-10 05:31:08 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a6f036106 | |||
| 7d55d98620 | |||
| 70b0e9d5e5 | |||
| fdd533aa3b | |||
| a44ed0aeb3 |
@@ -33,7 +33,7 @@ password_min_length = 9
|
|||||||
passthrough_senders =
|
passthrough_senders =
|
||||||
|
|
||||||
# list of e-mail recipients for which to accept outbound un-encrypted mails
|
# list of e-mail recipients for which to accept outbound un-encrypted mails
|
||||||
passthrough_recipients =
|
passthrough_recipients = xstore@testrun.org groupsbot@hispanilandia.net
|
||||||
|
|
||||||
#
|
#
|
||||||
# Deployment Details
|
# Deployment Details
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
[privacy]
|
[privacy]
|
||||||
|
|
||||||
passthrough_recipients = privacy@testrun.org
|
passthrough_recipients = privacy@testrun.org xstore@testrun.org groupsbot@hispanilandia.net
|
||||||
|
|
||||||
privacy_postal =
|
privacy_postal =
|
||||||
Merlinux GmbH, Represented by the managing director H. Krekel,
|
Merlinux GmbH, Represented by the managing director H. Krekel,
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ def test_read_config_testrun(make_config):
|
|||||||
assert config.username_min_length == 9
|
assert config.username_min_length == 9
|
||||||
assert config.username_max_length == 9
|
assert config.username_max_length == 9
|
||||||
assert config.password_min_length == 9
|
assert config.password_min_length == 9
|
||||||
assert config.passthrough_recipients == ["privacy@testrun.org"]
|
assert "privacy@testrun.org" in config.passthrough_recipients
|
||||||
assert config.passthrough_senders == []
|
assert config.passthrough_senders == []
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import importlib.resources
|
import importlib.resources
|
||||||
|
|
||||||
from pyinfra.operations import apt, files, systemd, server
|
from pyinfra.operations import apt, files, systemd, server
|
||||||
|
from pyinfra import host
|
||||||
|
from pyinfra.facts.systemd import SystemdStatus
|
||||||
|
|
||||||
|
|
||||||
def deploy_acmetool(nginx_hook=False, email="", domains=[]):
|
def deploy_acmetool(nginx_hook=False, email="", domains=[]):
|
||||||
@@ -55,6 +57,13 @@ def deploy_acmetool(nginx_hook=False, email="", domains=[]):
|
|||||||
group="root",
|
group="root",
|
||||||
mode="644",
|
mode="644",
|
||||||
)
|
)
|
||||||
|
if host.get_fact(SystemdStatus).get("nginx.service"):
|
||||||
|
systemd.service(
|
||||||
|
name="Stop nginx service to free port 80",
|
||||||
|
service="nginx",
|
||||||
|
running=False,
|
||||||
|
)
|
||||||
|
|
||||||
systemd.service(
|
systemd.service(
|
||||||
name="Setup acmetool-redirector service",
|
name="Setup acmetool-redirector service",
|
||||||
service="acmetool-redirector.service",
|
service="acmetool-redirector.service",
|
||||||
|
|||||||
@@ -37,21 +37,15 @@ class DNS:
|
|||||||
|
|
||||||
def get(self, typ: str, domain: str) -> str | None:
|
def get(self, typ: str, domain: str) -> str | None:
|
||||||
"""Get a DNS entry"""
|
"""Get a DNS entry"""
|
||||||
dig_result = self.shell(f"dig {typ} {domain}")
|
dig_result = self.shell(f"dig -r -q {domain} -t {typ} +short")
|
||||||
line_num = 0
|
line = dig_result.partition("\n")[0]
|
||||||
for line in dig_result.splitlines():
|
if line:
|
||||||
line_num += 1
|
return line
|
||||||
if line.strip() == ";; ANSWER SECTION:":
|
|
||||||
return dig_result.splitlines()[line_num].split("\t")[-1]
|
|
||||||
|
|
||||||
def check_ptr_record(self, ip: str, mail_domain) -> str:
|
def check_ptr_record(self, ip: str, mail_domain) -> bool:
|
||||||
"""Check the PTR record for an IPv4 or IPv6 address."""
|
"""Check the PTR record for an IPv4 or IPv6 address."""
|
||||||
result = self.get("-x", ip)
|
result = self.shell(f"dig -r -x {ip} +short").rstrip()
|
||||||
if result:
|
return result == f"{mail_domain}."
|
||||||
if ip_address(ip).version == 6:
|
|
||||||
result = result.split()[-1]
|
|
||||||
if result[:-1] == mail_domain:
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def show_dns(args, out):
|
def show_dns(args, out):
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ append_dot_mydomain = no
|
|||||||
|
|
||||||
readme_directory = no
|
readme_directory = no
|
||||||
|
|
||||||
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
|
# See http://www.postfix.org/COMPATIBILITY_README.html
|
||||||
# fresh installs.
|
compatibility_level = 3.6
|
||||||
compatibility_level = 2
|
|
||||||
|
|
||||||
# TLS parameters
|
# TLS parameters
|
||||||
smtpd_tls_cert_file=/var/lib/acme/live/{{ config.mail_domain }}/fullchain
|
smtpd_tls_cert_file=/var/lib/acme/live/{{ config.mail_domain }}/fullchain
|
||||||
|
|||||||
Reference in New Issue
Block a user