fixes SMTP server

This commit is contained in:
2026-01-08 21:10:08 +00:00
parent 64f2092161
commit e0170e82aa
2 changed files with 27 additions and 5 deletions

12
smtp/.msmtprc Normal file
View File

@@ -0,0 +1,12 @@
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/msmtp/msmtp.log
account default
eval echo from "$LOCAL_SMTP_ENVELOPE_FROM"
eval echo host "$REMOTE_SMTP_HOST"
eval echo port "$REMOTE_SMTP_PORT"
eval echo user "$REMOTE_SMTP_USER"
passwordeval cat "$REMOTE_SMTP_PASSWORD_FILE"

View File

@@ -1,13 +1,23 @@
FROM alpine:3.22
WORKDIR /
RUN apk add --no-cache git autoconf automake build-base gettext gettext-dev gnutls-dev libtool make texinfo
RUN git clone https://github.com/marlam/msmtp.git --branch msmtp-1.8.32 --single-branch --depth 1
RUN mkdir -p /var/msmtp
RUN apk --update --no-cache add git autoconf automake build-base gettext gettext-dev gnutls-dev libtool make texinfo && \
git clone https://github.com/marlam/msmtp.git --branch msmtp-1.8.32 --single-branch --depth 1
WORKDIR /msmtp
RUN autoreconf -fi && \
./configure && \
make && \
make install
ARG PORT=2500
EXPOSE $PORT
CMD ["msmtpd", "--port=$PORT"]
ARG LOCAL_SMTP_PORT
EXPOSE $LOCAL_SMTP_PORT
COPY .msmtprc ./
CMD msmtpd \
--auth=$LOCAL_SMTP_USER,'echo $LOCAL_SMTP_PASSWORD' \
--command='msmtp -C .msmtprc -f %F --' \
--interface=0.0.0.0 \
--log=/var/msmtp/msmtpd.log \
--port=$LOCAL_SMTP_PORT