You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-23 22:04:47 +02:00
Ignore newlines and comment-lines in postfix overrides
To make postfix override files understandable and readable, users may want to insert empty newlines and #-commented lines in their postfix override files too. This will now ignore such bogus-lines and not send them to `postconf`, which produced ugly errors in the past. closes #1098
This commit is contained in:
@@ -27,6 +27,10 @@ def start_podop():
|
||||
("senderlogin", "url", url + "sender/login/§")
|
||||
])
|
||||
|
||||
def is_valid_postconf_line(line):
|
||||
return not line.startswith("#") \
|
||||
and not line == ''
|
||||
|
||||
# Actual startup script
|
||||
os.environ["FRONT_ADDRESS"] = system.get_host_address_from_environment("FRONT", "front")
|
||||
os.environ["ADMIN_ADDRESS"] = system.get_host_address_from_environment("ADMIN", "admin")
|
||||
@@ -38,10 +42,12 @@ for postfix_file in glob.glob("/conf/*.cf"):
|
||||
|
||||
if os.path.exists("/overrides/postfix.cf"):
|
||||
for line in open("/overrides/postfix.cf").read().strip().split("\n"):
|
||||
if is_valid_postconf_line(line):
|
||||
os.system('postconf -e "{}"'.format(line))
|
||||
|
||||
if os.path.exists("/overrides/postfix.master"):
|
||||
for line in open("/overrides/postfix.master").read().strip().split("\n"):
|
||||
if is_valid_postconf_line(line):
|
||||
os.system('postconf -Me "{}"'.format(line))
|
||||
|
||||
for map_file in glob.glob("/overrides/*.map"):
|
||||
|
||||
1
towncrier/newsfragments/1098.misc
Normal file
1
towncrier/newsfragments/1098.misc
Normal file
@@ -0,0 +1 @@
|
||||
Ignore newlines and comment-lines in postfix overrides - this means you can now make your override configfiles much more readable.
|
||||
Reference in New Issue
Block a user