2017-09-24 14:42:40 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import jinja2
|
|
|
|
import os
|
|
|
|
import socket
|
|
|
|
import glob
|
|
|
|
|
|
|
|
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
|
|
|
|
|
|
|
|
# Actual startup script
|
|
|
|
os.environ["FRONT_ADDRESS"] = socket.gethostbyname("front")
|
|
|
|
|
2017-09-24 15:44:44 +02:00
|
|
|
for dovecot_file in glob.glob("/conf/*"):
|
|
|
|
convert(dovecot_file, os.path.join("/etc/dovecot", os.path.basename(dovecot_file)))
|
2017-09-24 14:42:40 +02:00
|
|
|
|
|
|
|
# Run postfix
|
|
|
|
os.system("chown -R mail:mail /mail /var/lib/dovecot")
|
2017-09-24 15:44:44 +02:00
|
|
|
os.execv("/usr/sbin/dovecot", ["dovecot", "-c", "/etc/dovecot/dovecot.conf", "-F"])
|