Merge branch 'master' into fix-sender-checks
This commit is contained in:
@@ -2,11 +2,13 @@ FROM alpine:3.8
|
||||
|
||||
RUN apk add --no-cache postfix postfix-pcre rsyslog \
|
||||
python3 py3-pip \
|
||||
&& pip3 install jinja2 podop
|
||||
&& pip3 install --upgrade pip \
|
||||
&& pip3 install jinja2 podop tenacity
|
||||
|
||||
COPY conf /conf
|
||||
COPY start.py /start.py
|
||||
|
||||
EXPOSE 25/tcp 10025/tcp
|
||||
VOLUME ["/data"]
|
||||
|
||||
CMD /start.py
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
# General
|
||||
###############
|
||||
|
||||
debug_peer_list = 0.0.0.0/0
|
||||
|
||||
# Main domain and hostname
|
||||
mydomain = {{ DOMAIN }}
|
||||
myhostname = {{ HOSTNAMES.split(",")[0] }}
|
||||
|
||||
@@ -8,6 +8,7 @@ smtp inet n - n - - smtpd
|
||||
10025 inet n - n - - smtpd
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=reject_unlisted_sender,reject_authenticated_sender_login_mismatch,permit
|
||||
-o smtpd_reject_unlisted_recipient={% if REJECT_UNLISTED_RECIPIENT %}{{ REJECT_UNLISTED_RECIPIENT }}{% else %}no{% endif %}
|
||||
-o cleanup_service_name=outclean
|
||||
outclean unix n - n - 0 cleanup
|
||||
-o header_checks=pcre:/etc/postfix/outclean_header_filter.cf
|
||||
|
||||
@@ -5,8 +5,10 @@ import os
|
||||
import socket
|
||||
import glob
|
||||
import shutil
|
||||
import tenacity
|
||||
import multiprocessing
|
||||
|
||||
from tenacity import retry
|
||||
from podop import run_server
|
||||
|
||||
|
||||
@@ -23,8 +25,12 @@ def start_podop():
|
||||
|
||||
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
|
||||
|
||||
@retry(stop=tenacity.stop_after_attempt(100), wait=tenacity.wait_random(min=2, max=5))
|
||||
def resolve():
|
||||
os.environ["FRONT_ADDRESS"] = socket.gethostbyname(os.environ.get("FRONT_ADDRESS", "front"))
|
||||
|
||||
# Actual startup script
|
||||
os.environ["FRONT_ADDRESS"] = socket.gethostbyname(os.environ.get("FRONT_ADDRESS", "front"))
|
||||
resolve()
|
||||
os.environ["HOST_ANTISPAM"] = os.environ.get("HOST_ANTISPAM", "antispam:11332")
|
||||
os.environ["HOST_LMTP"] = os.environ.get("HOST_LMTP", "imap:2525")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user