I installed Nextcloud with Postfix + Dovecot + Rspamd + PostgreSQL in a Debian 10 VPS according to this guide. And now everything works until I try to send an email (I can receive emails just fine thoug).
Then when I try to send an email it shows Error 500. And the log show this:
Jul 14 06:46:36 mail nextcloud[26951]: {"reqId":"CLe5VcGkSBnzs1ZjHhGx","level":4,"time":"2020-07-13T22:46:36-05:00","remoteAddr":"2800:370:c1:cde0:5d25:be47:899e:7634","user":"[email protected]","app":"mail","method":"POST","url":"/index.php/apps/mail/api/accounts/1/send","message":"Sending mail failed: Could not send message: Could not open secure TLS connection to the server.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36","version":"18.0.6.0"}
Jul 14 06:46:36 mail nextcloud[26951]: {"reqId":"CLe5VcGkSBnzs1ZjHhGx","level":3,"time":"2020-07-13T22:46:36-05:00","remoteAddr":"2800:370:c1:cde0:5d25:be47:899e:7634","user":"[email protected]","app":"mail","method":"POST","url":"/index.php/apps/mail/api/accounts/1/send","message":"{\"Exception\":\"OCA\\\\Mail\\\\Exception\\\\ServiceException\",\"Message\":\"Could not send message: Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,24]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Probando envio de correos\",\"Y estoy seguro de que no funcionar\\u00e1\",\"[email protected]\",\"\",\"\",false,24,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":125,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"send\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":299,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1008,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/apps/mail/api/accounts/1/send\"]},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":38,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"Line\":176,\"Previous\":{\"Exception\":\"Horde_Mime_Exception\",\"Message\":\"Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php\",\"line\":479,\"function\":\"send\",\"class\":\"Horde_Mime_Part\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"__class__\":\"Horde_Mime_Headers\"},{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"}]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"line\":174,\"function\":\"send\",\"class\":\"Horde_Mime_Mail\",\"type\":\"->\",\"args\":[{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"},false,false]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,24]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Probando envio de correos\",\"Y estoy seguro de que no funcionar\\u00e1\",\"[email protected]\",\"\",\"\",false,24,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":125,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"send\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":299,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1008,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/apps/mail/api/accounts/1/send\"]},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":38,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php\",\"Line\":1642,\"Previous\":{\"Exception\":\"Horde_Mail_Exception\",\"Message\":\"Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php\",\"line\":1620,\"function\":\"send\",\"class\":\"Horde_Mail_Transport_Smtphorde\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"From\":\"Pedro Stein <[email protected]>\",\"To\":\"[email protected]\",\"Cc\":\"\",\"Subject\":\"Probando envio de correos\",\"Message-ID\":\"<[email protected]>\",\"User-Agent\":\"Horde Application Framework 5\",\"Date\":\"Tue, 14 Jul 2020 03:46:36 +0000\",\"Content-Type\":\"text/plain; charset=utf-8\",\"MIME-Version\":\"1.0\",\"Content-Transfer-Encoding\":\"quoted-printable\"},null]},{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php\",\"line\":479,\"function\":\"send\",\"class\":\"Horde_Mime_Part\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"__class__\":\"Horde_Mime_Headers\"},{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"}]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"line\":174,\"function\":\"send\",\"class\":\"Horde_Mime_Mail\",\"type\":\"->\",\"args\":[{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"},false,false]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,24]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Probando envio de correos\",\"Y estoy seguro de que no funcionar\\u00e1\",\"[email protected]\",\"\",\"\",false,24,null,null,[],null]},{\"file\
Then I tried adding this to config.php according to a note on the changelogs:
'app.mail.verify-tls-peer' => false,
But it didn't work either:
Jul 14 16:58:02 mail nextcloud[27662]: {"reqId":"HboQ2ObJPRe0fJXTgNup","level":4,"time":"2020-07-14T08:58:02-05:00","remoteAddr":"2800:370:c1:cde0:5d25:be47:899e:7634","user":"[email protected]","app":"mail","method":"POST","url":"/index.php/apps/mail/api/accounts/1/send","message":"Sending mail failed: Could not send message: Could not open secure TLS connection to the server.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36","version":"18.0.6.0"}
Jul 14 16:58:02 mail nextcloud[27662]: {"reqId":"HboQ2ObJPRe0fJXTgNup","level":3,"time":"2020-07-14T08:58:02-05:00","remoteAddr":"2800:370:c1:cde0:5d25:be47:899e:7634","user":"[email protected]","app":"mail","method":"POST","url":"/index.php/apps/mail/api/accounts/1/send","message":"{\"Exception\":\"OCA\\\\Mail\\\\Exception\\\\ServiceException\",\"Message\":\"Could not send message: Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,29]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Otra prueba de mail de nextcloud\",\"Ahora con la opci\\u00f3n de tls en false sin comillas en el config\",\"[email protected]\",\"\",\"\",false,29,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":125,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"send\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":299,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1008,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/apps/mail/api/accounts/1/send\"]},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":38,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"Line\":176,\"Previous\":{\"Exception\":\"Horde_Mime_Exception\",\"Message\":\"Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php\",\"line\":479,\"function\":\"send\",\"class\":\"Horde_Mime_Part\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"__class__\":\"Horde_Mime_Headers\"},{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"}]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"line\":174,\"function\":\"send\",\"class\":\"Horde_Mime_Mail\",\"type\":\"->\",\"args\":[{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"},false,false]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,29]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Otra prueba de mail de nextcloud\",\"Ahora con la opci\\u00f3n de tls en false sin comillas en el config\",\"[email protected]\",\"\",\"\",false,29,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":125,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"send\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":299,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1008,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/apps/mail/api/accounts/1/send\"]},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":38,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php\",\"Line\":1642,\"Previous\":{\"Exception\":\"Horde_Mail_Exception\",\"Message\":\"Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php\",\"line\":1620,\"function\":\"send\",\"class\":\"Horde_Mail_Transport_Smtphorde\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"From\":\"Pedro Stein <[email protected]>\",\"To\":\"[email protected]\",\"Cc\":\"\",\"Subject\":\"Otra prueba de mail de nextcloud\",\"Message-ID\":\"<[email protected]>\",\"User-Agent\":\"Horde Application Framework 5\",\"Date\":\"Tue, 14 Jul 2020 13:58:02 +0000\",\"Content-Type\":\"text/plain; charset=utf-8\",\"MIME-Version\":\"1.0\",\"Content-Transfer-Encoding\":\"quoted-printable\"},null]},{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php\",\"line\":479,\"function\":\"send\",\"class\":\"Horde_Mime_Part\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"__class__\":\"Horde_Mime_Headers\"},{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"}]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"line\":174,\"function\":\"send\",\"class\":\"Horde_Mime_Mail\",\"type\":\"->\",\"args\":[{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"},false,false]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,29]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Otra prueba de mail de nextcloud\",\"Ahora con la opci\\u00f3n de tls en
I also verified every setup option mentioned in that guide just in case I made some typo or anything, but everything seems right.
Mail app version: (see apps admin page, e.g. 0.5.3)
1.4.1
Mailserver or service: (e.g. Outlook, Yahoo, Gmail, Exchange,...)
The webmail version ("mail" app in Nextcloud)
Operating system: (e.g. Debian 8)
Debian GNU/Linux 10 (Buster)
Web server: (e.g. Apache, Nginx,...)
Apache
Database: (e.g. MariaDB, SQLite or PostgreSQL)
PostgreSQL
PHP version: (e.g. 7.0)
PHP 7.3.19-1~deb10u1 (cli)
Nextcloud Version: (see admin page, e.g. 13.0.2)
18.0.6
Browser: (e.g. Firefox 48)
Brave Browser
Version 1.10.97 Chromium: 83.0.4103.116 (Official Build) (64-bit)
Operating system: (e.g. Arch Linux)
Linux Mint Debian Edition 4
The Nextcloud mail app offers an extensive logging system to make it easier identifying and tracking down bugs. Please enable debug mode and set the log level to debug in your admin settings. Then, try to reproduce your issue and take another look at data/nextcloud.log and data/horde_smtp.log.
Wow, the nextcloud log threw like 400 lines after this.
I hope it's fine that I attached the log itself and not pasted the whole log here!
I activated the debug mode and set its level to debug, and then I just logged in to nextcloud, went to the mail app and tried to send an email to my gmail address.
This is what I got from the logs:
I tried to read throgh it but I'm not sure what I'm looking for actually.
I see a lot of errors (I tink) but I'm not sure which ones are actually important :(
Should I check for something in particular?
ERROR: Server read/timeout error.
Strange. Is the server that slow? You could try increasing the timeout: https://github.com/nextcloud/mail/blob/master/doc/admin.md#smtp-timeout and set it to 20 or so.
ERROR: Server read/timeout error.
Strange. Is the server that slow? You could try increasing the timeout: https://github.com/nextcloud/mail/blob/master/doc/admin.md#smtp-timeout and set it to 20 or so.
Still the same error. But only this showed up (in nextcloud.log):
Jul 16 01:20:01 mail nextcloud[15196]: {"reqId":"wP9WmJ0d4onwPJQXTZug","level":4,"time":"2020-07-15T17:20:01-05:00","remoteAddr":"2800:370:c0:6910:4aae:c2da:4b7e:9a9f","user":"[email protected]","app":"mail","method":"POST","url":"/index.php/apps/mail/api/accounts/1/send","message":"Sending mail failed: Could not send message: Could not open secure TLS connection to the server.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36","version":"18.0.6.0"}
Jul 16 01:20:01 mail nextcloud[15196]: {"reqId":"wP9WmJ0d4onwPJQXTZug","level":3,"time":"2020-07-15T17:20:01-05:00","remoteAddr":"2800:370:c0:6910:4aae:c2da:4b7e:9a9f","user":"[email protected]","app":"mail","method":"POST","url":"/index.php/apps/mail/api/accounts/1/send","message":"{\"Exception\":\"OCA\\\\Mail\\\\Exception\\\\ServiceException\",\"Message\":\"Could not send message: Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,39]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Prueba de email\",\"Prueba\",\"[email protected]\",\"\",\"\",false,39,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":125,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"send\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":299,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1008,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/apps/mail/api/accounts/1/send\"]},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":38,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"Line\":176,\"Previous\":{\"Exception\":\"Horde_Mime_Exception\",\"Message\":\"Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php\",\"line\":479,\"function\":\"send\",\"class\":\"Horde_Mime_Part\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"__class__\":\"Horde_Mime_Headers\"},{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"}]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"line\":174,\"function\":\"send\",\"class\":\"Horde_Mime_Mail\",\"type\":\"->\",\"args\":[{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"},false,false]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,39]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Prueba de email\",\"Prueba\",\"[email protected]\",\"\",\"\",false,39,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":125,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\"},\"send\"]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php\",\"line\":47,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"send\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"function\":\"__invoke\",\"class\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\",\"type\":\"->\",\"args\":[{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":299,\"function\":\"call_user_func\",\"args\":[{\"__class__\":\"OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler\"},{\"accountId\":\"1\",\"_route\":\"mail.accounts.send\"}]},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1008,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/apps/mail/api/accounts/1/send\"]},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":38,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\",\"args\":[]}],\"File\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php\",\"Line\":1642,\"Previous\":{\"Exception\":\"Horde_Mail_Exception\",\"Message\":\"Could not open secure TLS connection to the server.\",\"Code\":100,\"Trace\":[{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php\",\"line\":1620,\"function\":\"send\",\"class\":\"Horde_Mail_Transport_Smtphorde\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"From\":\"Pedro Stein <[email protected]>\",\"To\":\"[email protected]\",\"Cc\":\"\",\"Subject\":\"Prueba de email\",\"Message-ID\":\"<[email protected]>\",\"User-Agent\":\"Horde Application Framework 5\",\"Date\":\"Wed, 15 Jul 2020 22:20:01 +0000\",\"Content-Type\":\"text/plain; charset=utf-8\",\"MIME-Version\":\"1.0\"},null]},{\"file\":\"/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php\",\"line\":479,\"function\":\"send\",\"class\":\"Horde_Mime_Part\",\"type\":\"->\",\"args\":[\"[email protected]\",{\"__class__\":\"Horde_Mime_Headers\"},{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"}]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Service/MailTransmission.php\",\"line\":174,\"function\":\"send\",\"class\":\"Horde_Mime_Mail\",\"type\":\"->\",\"args\":[{\"send8bit\":false,\"sep\":\"\\r\\n\",\"__class__\":\"Horde_Mail_Transport_Smtphorde\"},false,false]},{\"file\":\"/var/www/nextcloud/apps/mail/lib/Controller/AccountsController.php\",\"line\":345,\"function\":\"sendMessage\",\"class\":\"OCA\\\\Mail\\\\Service\\\\MailTransmission\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Mail\\\\Model\\\\NewMessageData\"},null,null,39]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":170,\"function\":\"send\",\"class\":\"OCA\\\\Mail\\\\Controller\\\\AccountsController\",\"type\":\"->\",\"args\":[1,\"Prueba de email\",\"Prueba\",\"[email protected]\",\"\",\"\",false,39,null,null,[],null]},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":99,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\"
And nothing in the hord_smtp log
I'm using a VPS with a single 2.6 GHz processor and 2048 MB of RAM (is it too bad?)
Then I tried adding this to config.php according to a note on the changelogs
I'm currently out of ideas on what might be going wrong there. Does the issue persist?
i think the mail app does only not support tls 1.3 via SMTP. I connected successfully if i remove the "!TLS1.2" from the Postfix config option.
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
We don't have own own TLS implementation. This is handled by php.
After some research this patch allows the TLS1.3 SMTP connection to the server.
Huh, interesting. Guess we should submit this upstream. Do you or shall I? :)
please do it