Skip to content

Commit 28b9ab4

Browse files
committed
MSMTP
1 parent 117a1ed commit 28b9ab4

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ADD http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg /etc/apt/trust
44

55
#add key and apt install etc
66
RUN chmod 644 /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg && echo "deb http://download.proxmox.com/debian/pbs buster pbs-no-subscription" > /etc/apt/sources.list.d/proxmox.list \
7-
&& apt-get update && apt-get install -y proxmox-backup-server=1.0.1-1 nfs-common supervisor \
7+
&& apt-get update && apt-get install -y proxmox-backup-server=1.0.1-1 nfs-common supervisor msmtp-mta gettext-base \
88
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
99

10+
COPY msmtprc /etc/msmtprc
1011
COPY pbs.ini /etc/supervisor/conf.d/supervisord.conf
1112
COPY docker-entrypoint.sh /
1213
RUN chmod a+x /docker-entrypoint.sh && chsh -s /bin/bash backup

Dockerfile.client

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM debian:buster
2+
3+
ADD http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg
4+
5+
#add key and apt install etc
6+
RUN chmod 644 /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg && echo "deb http://download.proxmox.com/debian/pbs buster pbs-no-subscription" > /etc/apt/sources.list.d/proxmox.list \
7+
&& apt-get update && apt-get install -y proxmox-backup-client=1.0.1-1 \
8+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

docker-compose.yml

+10
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@ services:
44
#volumes:
55
# - ./etc/cas/services:/etc/cas/services:rw
66
build: .
7+
environment:
8+
- MSMTP_HOST
9+
- MSMTP_PORT
10+
- MSMTP_TLS
11+
- MSMTP_STARTTLS
12+
- MSMTP_TLSCHECK
13+
- MSMTP_AUTH
14+
- MSMTP_USER
15+
- MSMTP_PASSWORD
16+
- MSMTP_FROM
717
ports:
818
- "8007:8007"

docker-entrypoint.sh

+13
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,17 @@ if [ ! -f /etc/proxmox-backup/user.cfg ]; then
1111
proxmox-backup-manager acl update / Admin --auth-id admin@pbs
1212
fi
1313

14+
#Build MSMTPRC File
15+
if [ -z $MSMTP_HOST ]; then export MSMTP_HOST=localhost; fi
16+
if [ -z $MSMTP_PORT ]; then export MSMTP_PORT=25; fi
17+
if [ -z $MSMTP_TLS ]; then export MSMTP_TLS=off; fi
18+
if [ -z $MSMTP_STARTTLS ]; then export MSMTP_STARTTLS=off; fi
19+
if [ -z $MSMTP_TLSCHECK ]; then export MSMTP_TLSCHECK=off; fi
20+
if [ -z $MSMTP_AUTH ]; then export MSMTP_AUTH=; fi
21+
if [ -z $MSMTP_USER ]; then export MSMTP_USER=; fi
22+
if [ -z $MSMTP_PASSWORD ]; then export MSMTP_PASSWORD=; fi
23+
if [ -z $MSMTP_FROM ]; then export MSMTP_FROM=root@localhost; fi
24+
cp /etc/msmtprc /tmp/msmtprc.env
25+
envsubst < /tmp/msmtprc.env > /etc/msmtprc
26+
1427
exec "$@"

msmtprc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
account default
2+
host $MSMTP_HOST
3+
port $MSMTP_PORT
4+
tls $MSMTP_TLS
5+
tls_starttls $MSMTP_STARTTLS
6+
tls_trust_file /etc/ssl/certs/ca-certificates.crt
7+
tls_certcheck $MSMTP_TLSCHECK
8+
auth $MSMTP_AUTH
9+
user $MSMTP_USER
10+
password "$MSMTP_PASSWORD"
11+
from "$MSMTP_FROM"
12+
logfile -

0 commit comments

Comments
 (0)