truecharts / public

Community Helm Chart Repository
https://truecharts.org
GNU Affero General Public License v3.0
1.14k stars 617 forks source link

Nextcloud unable to send emails via SMTP #9937

Closed dankar closed 1 year ago

dankar commented 1 year ago

App Name

nextcloud

SCALE Version

22.02.3

App Version

27.0.0_21.0.3

Application Events

None applicable

Application Logs

See description

Application Configuration

Optimize scripts enabled. Previews enabled. ClamAV, Collabora and Push Notify enabled. UserData mounted via HostPath (not shared with SMB.) Ingress with domain name (traefik) enabled, TLS via clusterissuer.

The rest are defaults, except for the mandatory passwords.

Describe the bug

The installation was done using the migration guide on truecharts.org.

When trying to send a test email in the administration settings for nextcloud, I get a response saying "A problem occurred while sending the email. Please revise your settings."

This is probably not relevant due to the following appearing in "occ log:tail":

Error     PHP                 Trying to access array offset on value of type bool at /var/www/html/apps/settings/lib/Settings/Admin/Server.php#76      2023-06-26T15:57:51+02:00  

  Warning   no app in context   Invalid cliBasedCronUser data provided to provideInitialState by settings                                                2023-06-26T15:57:51+02:00

To Reproduce

Install according to application configuration Configure SMTP email Try sending test email

Expected Behavior

Email get sent

Screenshots

nextcloud

Additional Context

None

I've read and agree with the following

dankar commented 1 year ago

I've verified that this issue is the same on a freshly installed nextcloud, without migration (only ClamAV and ingress set)

I also see now that the error message I am getting is only related to the cron job section. Either way, I'm unable to see anything in any logs about what is going wrong. My SMTP server is not getting a connection, and it works from other apps.

dankar commented 1 year ago

So I was able to figure this out at last:

I was using protonmail-bridge chart and new versions of Nextcloud will try STARTTLS automatically. This caused it to fail to validate the TLS certificate. Issue is that there is no error message displayed anywhere in any log I could find. So not an issue with truecharts, but maybe not getting any useful logs anywhere is? Don't know...

Solution was to add the following to config.php and then restart the chart:

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

PrivatePuffin commented 1 year ago

How you configure nextcloud is up to you. If you need help please ask on discord instead.

truecharts-admin commented 1 year ago

This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists