nextcloud / docker

⛴ Docker image of Nextcloud
https://hub.docker.com/_/nextcloud/
GNU Affero General Public License v3.0
6.08k stars 1.83k forks source link

SwiftMailer not working propperly #1857

Closed litronics closed 1 year ago

litronics commented 2 years ago

I am running the Nextcloud:fpm Image and after configuring the SMTP Settings, I get the following error Messages in regards to the SwiftMailer:

"userAgent":"--", "version":"24.0.3.2", "exception":{ "Exception":"Error", "Message":"strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at /var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php#144",

followed by the following message: "version":"24.0.3.2", "exception":{ "Exception":"Swift_TransportException", "Message":"Expected response code 220 but got an empty response\nLog data:\n++ Starting Swift_SmtpTransport\n!! Expected response code 220 but got an empty response (code: 0)",

When I remove the SMTP Settings from the configuration, I get the following error message:

"version":"24.0.3.2", "exception":{ "Exception":"Swift_TransportException", "Message":"Connection could not be established with host 127.0.0.1 :stream_socket_client(): Unable to connect to 127.0.0.1:25 (Connection refused)\nLog data:\n++ Starting Swift_SmtpTransport\n!! Connection could not be established with host 127.0.0.1 :stream_socket_client(): Unable to connect to 127.0.0.1:25 (Connection refused) (code: 0)",

I am wondering if there is ssmtp missing in the container or what else would be the reason that Swift_Transport would always try to connect to 127.0.0.1:25?

Be-Mann commented 1 year ago

"userAgent":"--", "version":"24.0.3.2", "exception":{ "Exception":"Error", "Message":"strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at /var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php#144",

This is a problem with non-existent/old trusted root certificates, running sudo update-ca-certificates helps here.

But a fix from Docker Container would still be very helpful!

joshtrichards commented 1 year ago

Hi @litronics - Thanks for your report. Unfortunately it lacks information needed to reproduce it. Can you provide some details about your SMTP settings? i.e. what they are (obviously excluding credentials), how/where you set them (i.e. via environment variables in compose or in the web UI, etc.), and basics about the target SMTP server/service you're trying.

I agree this is a weird error message if you're not trying to use 127.0.0.1. Perhaps there's some room for improvement upstream a better error indication.

Also, did the suggestion from @Be-Mann make any difference? (I can't tell if it's relevant without more details on your setup).

joshtrichards commented 1 year ago

Closing due to "needs info".