1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-11-29 22:37:58 +02:00

Add authentication for email relays

This commit is contained in:
Daniel Huber
2019-03-04 18:52:04 +01:00
parent 42953eb70b
commit 7dcb2eb006
4 changed files with 15 additions and 1 deletions

View File

@@ -48,6 +48,13 @@ for map_file in glob.glob("/overrides/*.map"):
os.system("postmap {}".format(destination))
os.remove(destination)
if "RELAYUSER" in os.environ:
path = "/etc/postfix/sasl_passwd"
fileContent = "{} {}:{}".format(os.environ["RELAYHOST"], os.environ["RELAYUSER"], os.environ["RELAYPASSWORD"])
with open(path, "w") as f:
f.write(fileContent)
os.system("postmap {}".format(path))
convert("/conf/rsyslog.conf", "/etc/rsyslog.conf")
# Run Podop and Postfix