Hi everyone!
I followed this very complete guide on how to install Nextcloud with Postfix + Dovecot + Rspamd + PostgreSQL and everything seemed to work until I tried to send an email and got an Error 500.
I checked the logs and I have this huge entry:
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":"my@email.com","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":"my@email.com","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\",\"mypersonalemail@gmail.com\",\"\",\"\",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\":[\"mypersonalemail@gmail.com\",{\"__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\",\"mypersonalemail@gmail.com\",\"\",\"\",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\":[\"mypersonalemail@gmail.com\",{\"From\":\"Pedro Stein <my@email.com>\",\"To\":\"mypersonalemail@gmail.com\",\"Cc\":\"\",\"Subject\":\"Probando envio de correos\",\"Message-ID\":\"<20200714034636.Horde.sfMqbkEOKZ3W96hIXTc1F5r@mail.email.com>\",\"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\":[\"mypersonalemail@gmail.com\",{\"__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\",\"mypersonalemail@gmail.com\",\"\",\"\",false,24,null,null,[],null]},{\"file\
Seems that is something related with TLS, but I’ve been searching for every thing I did with that guide and everything seems right. I also read another topic here, but the OP only stated that he/she switched from Godaddy and that solved the problem. Could it really be that? Because I’ve been using that domain for years with paid webmail services and never had any problem with the dns entries.
If someone could lend me a hand I’d really appreciate it.
Thanks!