From 8e64d18c2b5a980a2828913898d58206f01e5e7c Mon Sep 17 00:00:00 2001 From: Michael Gibson Date: Thu, 21 May 2020 15:45:01 -0500 Subject: [PATCH] Fixed socat/ports. --- Dockerfile | 4 ++-- entrypoint | 6 ++++++ initproton | 10 ++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index ece105c..56936f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ RUN make build-nogui FROM alpine:edge ENV LANG C.UTF-8 -ENV SMTP_PORT 1025 -ENV IMAP_PORT 1143 +ENV SMTP_PORT 25 +ENV IMAP_PORT 143 COPY --from=build /usr/src/proton-bridge/Desktop-Bridge /bin/protonmail-bridge RUN apk add --no-cache \ libsecret \ diff --git a/entrypoint b/entrypoint index 09fbe3b..acb0c3b 100755 --- a/entrypoint +++ b/entrypoint @@ -4,6 +4,7 @@ # fallback USER_ID=${PUID:-9001} + GROUP_ID=${PGID:-$USER_ID} echo "Starting with UID : $USER_ID:$GROUP_ID" addgroup -g $GROUP_ID proton @@ -12,4 +13,9 @@ chown -R ${USER_ID}:${GROUP_ID} /var/lib/proton export HOME=/var/lib/proton +# socat will make the conn appear to come from 127.0.0.1 +# ProtonMail Bridge currently expects that. +socat TCP-LISTEN:$SMTP_PORT,fork TCP:127.0.0.1:1025 & +socat TCP-LISTEN:$IMAP_PORT,fork TCP:127.0.0.1:1143 & + exec /sbin/su-exec proton "$@" \ No newline at end of file diff --git a/initproton b/initproton index 0979cf2..d411fa3 100755 --- a/initproton +++ b/initproton @@ -3,8 +3,8 @@ set -eufo pipefail BRIDGE=/bin/protonmail-bridge PRINT_INFO=${PRINT_INFO:-""} -SMTP_PORT=${SMTP_PORT:-"1025"} -IMAP_PORT=${IMAP_PORT:-"1143"} +SMTP_PORT=${SMTP_PORT:-"25"} +IMAP_PORT=${IMAP_PORT:-"143"} #### INIT PASS_FILE=${PASS_FILE:-} @@ -31,12 +31,6 @@ if [ -n "$PRINT_INFO" ]; then echo info | $BRIDGE --cli | egrep '(Username|Password)' | sort -ru fi -# socat will make the conn appear to come from 127.0.0.1 -# ProtonMail Bridge currently expects that. -# It also allows us to bind to the real ports :) -socat TCP-LISTEN:$SMTP_PORT,fork TCP:127.0.0.1:1025 & -socat TCP-LISTEN:$IMAP_PORT,fork TCP:127.0.0.1:1143 & - # Fake a terminal, so it does not quit because of EOF... rm -f faketty mkfifo faketty