E-Mail in Nextcloud 26.0.0 funktioniert nicht mehr

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 26.0.0
Operating system and version (eg, Ubuntu 20.04): replace me
Apache or nginx version (eg, Apache 2.4.25): 1.23.3
PHP version (eg, 7.4): 8.0

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Update from 25.0.4

The output of your Nextcloud log in Admin > Logging:

{"reqId":"bwBqcbMPqw3MhGvpKZ2r","level":3,"time":"2023-03-24T09:46:50+00:00","remoteAddr":"192.168.144.37","user":"root","app":"no app in context","method":"POST","url":"/ocs/v2.php/cloud/users/XXX%40XXX/welcome","message":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\SocketStream::setTimeout(): Argument #1 ($timeout) must be of type float, string given, called in /var/www/nextcloud/lib/private/Mail/Mailer.php on line 305 in file '/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/Stream/SocketStream.php' line 37","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36","version":"26.0.0.11","exception":{"Exception":"Exception","Message":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\SocketStream::setTimeout(): Argument #1 ($timeout) must be of type float, string given, called in /var/www/nextcloud/lib/private/Mail/Mailer.php on line 305 in file '/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/Stream/SocketStream.php' line 37","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":63,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\SocketStream::setTimeout(): Argument #1 ($timeout) must be of type float, string given, called in /var/www/nextcloud/lib/private/Mail/Mailer.php on line 305","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Mail/Mailer.php","line":305,"function":"setTimeout","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\SocketStream","type":"->"},{"file":"/var/www/nextcloud/lib/private/Mail/Mailer.php","line":276,"function":"getSmtpInstance","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Mail/Mailer.php","line":189,"function":"getInstance","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Mailer/NewUserMailHelper.php","line":186,"function":"send","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/var/www/nextcloud/apps/provisioning_api/lib/Controller/UsersController.php","line":1411,"function":"sendMail","class":"OCA\\Settings\\Mailer\\NewUserMailHelper","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"resendWelcomeMessage","class":"OCA\\Provisioning_API\\Controller\\UsersController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":63,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/Stream/SocketStream.php","Line":37},"CustomMessage":"--"}}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

 'app.mail.imap.timeout' => 20,
  'app.mail.smtp.timeout' => 2,
  'mail_from_address' => 'share',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => 'domain.de',
  'mail_smtptimeout' => '30',
  'app.mail.transport' => 'php-mail',
  'mail_smtphost' => 'XXX.XXX.XXX.XXX',
  'mail_smtpport' => '2525',

The output of your Apache/nginx/system log in /var/log/nginx/access.log:

[24/Mar/2023:10:46:50 +0100] "POST /ocs/v2.php/cloud/users/user%40domain.de/welcome HTTP/2.0" 500 163 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

I’m not entirely sure, but I have a suspicion.
Bin mir nicht ganz sicher, habe aber ein Verdacht

Try it like this:
Versuche es mal so:

'mail_smtptimeout' => 30,
(without the qoutes around the 30)
(ohne den Anführungszeichen um die 30)

If problem persists, try it with mail_smtptimeout completely removed from your config.php
Wenn das Problem bleibt, versuche es mal ganz ohne mail_smtptimeout in der config.php

1 Like

Hi,

And just if you afterwards come across the issue, that the test mail cannot be sent out, read this issue, where a potential fix is already provided:

:grinning:
Das hat funktioniert! Vielen Dank!!!

Was nun genau?
Eventuell als “Lösung” kennzeichnen, damit spätere User es finden.

Der Wechsel auf Symphony erklärt auch noch eine andere Änderung, die ich durchführen musste, damit E-Mails zugestellt werden:

Unable to connect with STARTTLS: stream_socket_enable_crypto(): Peer certificate CN=host@domain.de' did not match expected CN=62.159.XXX.XXX’

Das ging vorher auch mit IP-Adresse.

Mit den beiden Änderungen läuft die E-Mailzustellung einwandfrei.

1 Like

Was genau muss ich ändern und wo?

Bei mir hat die Lösung von gache56 (Siehe obigen github Eintrag, ca. 2/3), also in config.php die zusätzlichen Parameter, die in der Lösung angegeben sind eintragen.
LG