shenxn / protonmail-bridge-docker

ProtonMail IMAP/SMTP Bridge Docker container
GNU General Public License v3.0
406 stars 82 forks source link

Kubernetes Nextcloud: IMAP server is not reachable #75

Open johnsmitth opened 1 year ago

johnsmitth commented 1 year ago

I'm kindof at my wits end here.

The container is running and linked to my Protonmail account, but nomatter what settings I try NextCloud keeps telling me "IMAP server is not reachable" when I try to add the IMAP and SMPT settings.

I've tried following the suggested issue https://github.com/shenxn/protonmail-bridge-docker/issues/6 which just exposes port 25 (and presumably 143 for IMAP). I've tried exposing ports 1025 and 1143 (which protonmail-bridge says the services are running on). I've tried mapping ports 1025 and 1143 to ports 25 and 143 respectively. I've tried NodePort, and i've tried ClusterIP. I've tried security:none and security:starttls. For the IMAP host I've tried using the Kubernetes service name, the full Kubernbetes internal DNS address, and even the internal Kubernetes IP address of the service directly.

NextCloud had no problems connecting to the pod running MariaDB so clearly it can see other pods in the network, but no matter what I try, I'm coming up dougnuts with this Protonmail-Bridge container.... As far as NextCloud is concerned it doesn't exist.

Anyone else had similar issues and managed to get it working?

twaananen commented 1 year ago

This is propably because protonmail-bridge only listens to connections from localhost / 127.0.0.1 https://github.com/ProtonMail/proton-bridge/pull/270 You can 'fix' it by placing this line in build.sh after checkout and building the image yourself. sed -i 's/127.0.0.1/0.0.0.0/g' internal/constants/constants.go Edit: this is a more complete comment for nextcloud.

zastrixarundell commented 12 months ago

I haven't fixed my issue fully, but at least I'm communicating with protonmail-bridge. This comment helped me, nextcloud refused to communicate with network-bridge. Now I'm getting 2023/11/28 22:50:27 socat[41] E connect(5, AF=2 127.0.0.1:1025, 16): Connection refused though.

The issue is 100% now what @twaananen did mention, where it only allow for 127.0.0.1. They disabled non-localhost on purpose.