From eb46e769732cbb6ef11ea964121ab6af02c4cbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Stocki?= Date: Thu, 26 Nov 2020 12:55:11 +0100 Subject: [PATCH] postfix config initial --- Dockerfile | 5 ++++- entrypoint.sh | 6 ++++++ main.cf | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 main.cf diff --git a/Dockerfile b/Dockerfile index 8b162c0..d6e1119 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,10 @@ RUN apt-get update && \ echo "deb http://download.proxmox.com/debian/pbs buster pbs-no-subscription" > /etc/apt/sources.list.d/pbs-no-subscription.list && \ wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg && \ apt-get update && \ - apt-get install -y proxmox-backup-server + apt-get install -y proxmox-backup-server postfix + +ENV POSTFIX_RELAY_HOST=127.0.0.1 +COPY main.cf /etc/postfix/main.cf #Activate backup user RUN chsh -s /bin/bash backup diff --git a/entrypoint.sh b/entrypoint.sh index afb4e45..539a3ec 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,10 +8,16 @@ chmod -R 700 /var/lib/proxmox-backup chown -R backup:backup /datastore chmod -R 700 /datastore +#Change postfix config +sed -i "s/smtp unix - - y - - smtp/smtp unix - - n - - smtp/g" /etc/postfix/master.cf +sed -i "s/docker_hostname/$(hostname)/g" /etc/postfix/main.cf +sed -i "s/\#relayhost = /\relayhost = $(POSTFIX_RELAY_HOST)/g" /etc/postfix/main.cf + #Set password from environment variable echo "root:$ROOT_PASSWD" | chpasswd # Start the first process +/usr/bin/postfix start ./usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-api & sleep 10 diff --git a/main.cf b/main.cf new file mode 100644 index 0000000..d2ecf89 --- /dev/null +++ b/main.cf @@ -0,0 +1,42 @@ +# See /usr/share/postfix/main.cf.dist for a commented, more complete version + + +# Debian specific: Specifying a file name will cause the first +# line of that file to be used as the name. The Debian default +# is /etc/mailname. +myorigin = docker_hostname + +smtpd_banner = $myhostname ESMTP (Debian/GNU) +biff = no + +# appending .domain is the MUA's job. +append_dot_mydomain = no + +# Uncomment the next line to generate "delayed mail" warnings +#delay_warning_time = 4h + +readme_directory = no + +# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on +# fresh installs. +compatibility_level = 2 +maillog_file=/var/log/postfix.log + + +# TLS parameters +smtp_use_tls=no + +# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for +# information on enabling SSL in the smtp client. + +smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated +myhostname = docker_hostname +alias_maps = hash:/etc/aliases +alias_database = hash:/etc/aliases +mydestination = $myhostname, docker_hostname, localhost.localdomain, localhost +#relayhost = +mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 +mailbox_size_limit = 0 +recipient_delimiter = + +inet_interfaces = all +inet_protocols = all \ No newline at end of file