-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
tl;dr Filing a request for new feature that puts content from configuration (config.php) to setStreamOptions. I am also available to create/send patch, but wanted to first file the issue and see if this would get be accepted. Since setStreamOptions accept ordinary array, it could fit nicely in config.php IMHO, as mail_smtpstreamoptions (following current namespaces there)
Steps to reproduce
I am having Nextcloud locally (QNAP), but mail provider that I want to use is fastmail.
- Fastmail is fairly advanced mail provider, yet I didn't found that they have ability to allow less secure apps, like google is having.
- I am using SMTP as an
mail_smtpmodeand none of the configuration parameters is working for me. - I also cannot change QNAP easily (add cert/move instance domain)
So, at the end, I have to change Nextcloud:) So, based on this this is my dance I am doing whenever Mailer.php is overwitten:
$transport->setStreamOptions(array('ssl' => array('allow_self_signed' => true, 'verify_peer' => false, 'verify_peer_name' => false)));(in Mailer.php in getSmtpInstance)
We might add separate config param to allow specifically this (allow_self_signed, _verify_peer=false...), but this is just promoting insecure usage and exposing setStreamOptions seems like a more generic solution.
Expected behaviour
Test mail should be sent when SMTP with my setup is sent
Actual behaviour
Uncaught Swift_TransportException: Connection could not be established with host smtp.fastmail.com
Server configuration
Operating system:
QNAP
Web server:
Apache2
Database:
PGSQL
PHP version:
7.x
Nextcloud version: (see Nextcloud admin page)
14.x
Updated from an older Nextcloud/ownCloud or fresh install:
Updated
Where did you install Nextcloud from:
tar.gz