add msmtp for debug
Some checks are pending
Test / build (push) Waiting to run

This commit is contained in:
finn 2024-07-07 10:46:37 -07:00
parent c65f98a437
commit a22a313474
4 changed files with 44 additions and 20 deletions

View File

@ -6,6 +6,7 @@ RUN apk update && \
apk add bash gawk cyrus-sasl cyrus-sasl-login cyrus-sasl-crammd5 mailx \ apk add bash gawk cyrus-sasl cyrus-sasl-login cyrus-sasl-crammd5 mailx \
postfix && \ postfix && \
apk add make go pkgconfig libsecret libsecret-dev git gpg gpg-agent pass && \ apk add make go pkgconfig libsecret libsecret-dev git gpg gpg-agent pass && \
apk add msmtp && \
rm -rf /var/cache/apk/* && \ rm -rf /var/cache/apk/* && \
mkdir -p /var/log/supervisor/ /var/run/supervisor/ && \ mkdir -p /var/log/supervisor/ /var/run/supervisor/ && \
sed -i -e 's/inet_interfaces = localhost/inet_interfaces = all/g' /etc/postfix/main.cf sed -i -e 's/inet_interfaces = localhost/inet_interfaces = all/g' /etc/postfix/main.cf
@ -18,21 +19,18 @@ RUN gpg-agent --daemon --batch --disable-scdaemon
RUN gpg --quick-gen-key --batch --passphrase '' pmbkey RUN gpg --quick-gen-key --batch --passphrase '' pmbkey
RUN pass init pmbkey RUN pass init pmbkey
COPY dotmsmtprc /root/.msmtprc
COPY run.sh / COPY run.sh /
COPY passpgp.sh /
RUN chmod +x /run.sh RUN chmod +x /run.sh
RUN chmod +x /passpgp.sh
RUN newaliases RUN newaliases
# ProtonMailBridge # ProtonMailBridge
RUN git clone https://github.com/ProtonMail/proton-bridge.git pb RUN git clone https://github.com/ProtonMail/proton-bridge.git pmb
WORKDIR pb WORKDIR pmb
RUN echo "BUILDING BRIDGE" RUN echo "BUILDING BRIDGE"
RUN make build-nogui RUN make build-nogui
RUN rm -rf /root/.cache && rm -rf /root/go RUN rm -rf /root/.cache && rm -rf /root/go
WORKDIR /
EXPOSE 25 EXPOSE 25
#ENTRYPOINT ["/run.sh"] #ENTRYPOINT ["/run.sh"]
CMD ["/run.sh"] CMD ["/run.sh"]

View File

@ -1,6 +1,6 @@
version: '2' version: '2'
services: services:
dpo: pmb:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
@ -11,19 +11,19 @@ services:
- .env - .env
restart: always restart: always
volumes: volumes:
- dpo_root:/root - pmb_root:/root
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
networks: networks:
- mn - pmb_mailnet
deb: deb:
image: debian:latest image: debian:latest
tty: yes tty: yes
stdin_open: yes stdin_open: yes
networks: networks:
- mn - pmb_mailnet
networks: networks:
mn: pmb_mailnet:
volumes: volumes:
dpo_root: pmb_root:

28
dotmsmtprc Normal file
View File

@ -0,0 +1,28 @@
# (debian) cat /usr/share/doc/msmtp/examples/msmtprc-user-example
# Example for a user configuration file ~/.msmtprc
# With modern mail services that publish autoconfiguration information,
# you can simply run 'msmtp --configure yourmail@example.com' to get
# a basic working configuration.
# This example focusses on TLS and authentication. Features not used here
# include logging, timeouts, SOCKS proxies, TLS parameters, Delivery Status
# Notification (DSN) settings, and more.
# Set default values: use the mail submission port 587, and always use TLS.
# On this port, TLS is activated via STARTTLS.
defaults
port 25
tls off
tls_starttls off
# Define a mail account at a freemail service
account pmb
# Host name of the SMTP server
host pmb
# Envelope-from address
from joe_smith@freemail.example
# Authentication
auth off
#user joe.smith

14
run.sh
View File

@ -2,16 +2,13 @@
[ "${DEBUG}" == "yes" ] && set -x [ "${DEBUG}" == "yes" ] && set -x
# GPG Area # GPG/PMB Area -------------------
#exec gpg-agent --daemon --batch --disable-scdaemon
gpg-agent --daemon --batch --disable-scdaemon gpg-agent --daemon --batch --disable-scdaemon
# ProtonMail bridge has really bad timeout/retry logic:
sleep 2
/pmb/bridge -n &
# Postfix area ------------------
# Postfix area
function add_config_value() { function add_config_value() {
local key=${1} local key=${1}
@ -46,6 +43,7 @@ add_config_value "myorigin" '$mydomain'
add_config_value "relayhost" "[${SMTP_SERVER}]:${SMTP_PORT}" add_config_value "relayhost" "[${SMTP_SERVER}]:${SMTP_PORT}"
add_config_value "smtp_use_tls" "yes" add_config_value "smtp_use_tls" "yes"
if [ ! -z "${SMTP_USERNAME}" ]; then if [ ! -z "${SMTP_USERNAME}" ]; then
# Following line added for proton bridge
add_config_value "smtp_sasl_mechanism_filter" "login" add_config_value "smtp_sasl_mechanism_filter" "login"
add_config_value "smtp_sasl_auth_enable" "yes" add_config_value "smtp_sasl_auth_enable" "yes"
add_config_value "smtp_sasl_password_maps" "lmdb:/etc/postfix/sasl_passwd" add_config_value "smtp_sasl_password_maps" "lmdb:/etc/postfix/sasl_passwd"