Can't seem to send emails through SMTP server with Proton Bridge

Hi there,

I have the NC snap installed on Ubuntu 22.04. I am running the ProtonMail Bridge in CLI mode locally, and have it configured correctly as far as I can tell. It looks like Nextcloud does not like the self-generated certificate for TLS to work, and there is no option to change that behavior from what I can tell.

However, Proton Bridge also accepts non-encrypted SMTP from localhost. So I changed the encryption settings in NC to “None”.

As it turns out, NC doesn’t even attempt to connect to port 1025 on localhost; my debug logs on the bridge don’t show any SMTP interaction at all, encrypted or not.

Is there maybe some limitation in the Snap that would prevent outbound SMTP traffic from Nextcloud?

Thanks,
Stephan

1 Like

Hi there, I like your topic,

i would like to try to add the cli version of the proton mail bridge to my Nextcloud server, too. As it seems it will not even work… Actually the Nextcloud mail client was too limited for me that I would not even use it at all… I just did not check the last half years updates of the mail app yet.

i suppose that you have support at Proton AG (like me)?
I do not have support at Nextcloud, but as I like to have integration fun, so i bet you also do no have Nextcloud support.

My first point:
Today, I was following the OFFICIAL explanation of Proton AG how to integrate with Thunderbird on Linux. that I shall accept that Thunderbird ignores the self signed certificate on the 127.0.0.1 port 1143 and port 1025. I was feeling awkward to accept this, and now i see that this again breaks other possibilities like a Nextcloud integration.

It is strange that Proton AG cannot make an integration with a REAL certificate, that is accepted by Thunderbird from scratch, I suppose it could be connected to the fact that IP certificates are not accepted anymore usually. So the Proton mail bridge would maybe need the certificate with the CN of the local machine. Maybe localhost could be a workaround instead of 127.0.0.1?

Next week, I will try to discuss this fact of the certificate with Proton AG and will most likely learn more about this topic… If you already found out more in 19 days, I am happy to read your updates…

Thank you and wish you a good start for the next week.

2 Likes

Hello, I’m attempting to send a test email from Nextcloud AIO to a shenxn/protonmail-bridge docker container started on the nextcloud-aio network:

docker run --network=nextcloud-aio -d --name=protonmail-bridge -v protonmail:/root -p 127.0.0.1:1025:25/tcp -p 127.0.0.1:1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge

I set the loglevel to 0 & am getting the following error:

		"Exception": "Symfony\\Component\\Mailer\\Exception\\TransportException",
		"Message": "Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed",

Is this the same error you are getting?

Adding to config.php fixed the issue:

'mail_smtpstreamoptions' =>
  array (
    'ssl' =>
    array (
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
    ),
  ),