diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile index 50e862c..6384328 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ -FROM rawmind/alpine-monit:5.25-3 -MAINTAINER Fabio Rauber +FROM alpine:3.15 +LABEL MAINTAINER="Fabio Rauber " -RUN apk add --no-cache bash postfix postfix-pcre rsyslog +RUN apk add --no-cache bash postfix postfix-pcre COPY conf /etc/postfix -COPY rsyslog.conf /etc/rsyslog.conf - -COPY monit-service.conf /opt/monit/etc/conf.d VOLUME ["/var/spool/postfix"] +ENTRYPOINT ["etc/postfix/postfix-service.sh"] + +CMD [ "start" ] + EXPOSE 25 diff --git a/conf/main.cf b/conf/main.cf old mode 100644 new mode 100755 index dd2e0d9..ab4c7c6 --- a/conf/main.cf +++ b/conf/main.cf @@ -55,3 +55,4 @@ smtpd_recipient_restrictions = ############### # Extra Settings ############### +maillog_file = /dev/stdout \ No newline at end of file diff --git a/conf/master.cf b/conf/master.cf old mode 100644 new mode 100755 index 3d98491..ab2570e --- a/conf/master.cf +++ b/conf/master.cf @@ -40,3 +40,4 @@ discard unix - - n - - discard lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache +postlog unix-dgram n - n - 1 postlogd diff --git a/conf/outclean_header_filter b/conf/outclean_header_filter old mode 100644 new mode 100755 diff --git a/conf/postfix-service.sh b/conf/postfix-service.sh index 64084d7..f805f71 100755 --- a/conf/postfix-service.sh +++ b/conf/postfix-service.sh @@ -38,10 +38,8 @@ function serviceStart { serviceConf # Actually run Postfix log "[ Starting Postfix... ]" - rm -f /var/run/rsyslogd.pid - nohup /usr/lib/postfix/master & + nohup /usr/sbin/postfix start-fg & echo $! > /var/run/postfix.pid - nohup rsyslogd -n & } function serviceStop { @@ -53,10 +51,10 @@ function serviceRestart { log "[ Restarting Postfix... ]" serviceStop serviceStart - /opt/monit/bin/monit reload } export DOMAIN=${DOMAIN:-"localhost"} +export HOSTNAME=${HOSTNAME:-"localhost"} export MESSAGE_SIZE_LIMIT=${MESSAGE_SIZE_LIMIT:-"50000000"} export RELAYNETS=${RELAYNETS:-""} export RELAYHOST=${RELAYHOST:-""} @@ -73,4 +71,4 @@ case "$1" in ;; *) echo "Usage: $0 restart|start|stop" ;; -esac +esac \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..74a6e6f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2' +services: + postfix: + build: . + ports: + - 25 + entrypoint: /bin/bash + tty: true \ No newline at end of file diff --git a/monit-service.conf b/monit-service.conf deleted file mode 100644 index e23f057..0000000 --- a/monit-service.conf +++ /dev/null @@ -1,4 +0,0 @@ -check process master with pidfile /var/run/postfix.pid - start program = "/etc/postfix/postfix-service.sh start" - stop program = "/etc/postfix/postfix-service.sh stop" - if failed port 25 type tcp for 5 cycles then exec "/opt/monit/bin/monit quit"