KostyaEsmukov / smtp_to_telegram

A small program that listens for SMTP and sends all incoming Email messages to Telegram
MIT License
316 stars 76 forks source link

Make it to run port 25 #54

Closed i9602097 closed 1 year ago

i9602097 commented 1 year ago

My english is so bad, but this PR can make it to run below port 1024. I hope you can understand.

KostyaEsmukov commented 1 year ago

You're proposing to change the default listening port for everyone, which is not going to be merged.

Changing the listening port is as simple as providing the required ST_SMTP_LISTEN env to the container creation command:

docker run \
    --name smtp_to_telegram \
    -e ST_TELEGRAM_CHAT_IDS=<CHAT_ID1>,<CHAT_ID2> \
    -e ST_TELEGRAM_BOT_TOKEN=<BOT_TOKEN> \
    -e ST_SMTP_LISTEN="0.0.0.0:25" \
    kostyaesmukov/smtp_to_telegram

Docker engine already allows unprivileged processes to bind ports below 1024, see https://stackoverflow.com/a/66892807. For non-docker runtimes the NET_BIND_SERVICE capability can also be specified on container creation.