diff --git a/entrypoint b/entrypoint index 6abe4c6..9fdd252 100755 --- a/entrypoint +++ b/entrypoint @@ -13,6 +13,7 @@ export HOME=/var/lib/proton # The ProtonMail Bridge expects connections from 127.0.0.1. Use socat to # redirect incoming connections to localhost. Also, this allows us to use # the default SMTP/IMAP ports. +setcap 'cap_net_bind_service=+ep' /usr/bin/socat socat TCP-LISTEN:25,fork TCP:127.0.0.1:1025 & socat TCP-LISTEN:143,fork TCP:127.0.0.1:1143 & diff --git a/initproton b/initproton index 53b72dd..71b4103 100755 --- a/initproton +++ b/initproton @@ -2,6 +2,7 @@ set -eufo pipefail BRIDGE=/bin/protonmail-bridge +FIFO=/tmp/fifo PRINT_INFO=${PRINT_INFO:-""} #### INIT @@ -31,6 +32,7 @@ if [ -n "$PRINT_INFO" ]; then fi # Fake a terminal, so it does not quit because of EOF... -rm -f faketty -mkfifo faketty -cat faketty | $BRIDGE --cli \ No newline at end of file +if [ ! -e "$FIFO" ]; then + mkfifo $FIFO +fi +cat $FIFO | $BRIDGE --cli \ No newline at end of file