[details="I have a protonbridge setup to handle mail on the nextcloud server. This works with users being able to provide the same protonmail smtp bridge credentials to send/receive emails.
But when I visit Basic setting to setup email notifications for adding new users and select the send notification they never receive the email.
What happens is the send notification to user reports back email sent. but nothing is actually sent
I have checked the following resources:
I have also gone through numerous online suggestions and have been able to turn on smtp in debug mode to get closer to the root problem. I have also verified firewall for the port smtp is using is allowing the port 1025 traffic and no blocks noted in the firewall log for it.
[/details]
The Basics
-
Nextcloud Server version 30.0.8:
-
Operating system and version:
Operating System: Linux 6.8.0-52-generic x86_64
|Description:|Ubuntu 22.04.5 LTS|
|Release:|22.04|
|Codename:|jammy| -
Web server and version:
replace me
-
Reverse proxy and version _(e.g. nginx 1.27.2)
nginx version: nginx/1.27.4 -
PHP version :
PHP 8.3.19 (cli) (built: Mar 13 2025 17:44:15) (NTS) -
Is this the first time you’ve seen this error? (Yes / No):
It has been at least two years since I have needed to add new users. But yes, prior versions were working, 28 (?) -
When did this problem seem to first start?
It is occurring as of version 30, but again have not used this feature with other prior versions and can not tell if it was there prior to this version or not. -
Installation method
Downloaded to my bare metal zip file from the nextcloud admin panel stating my version was out of date and then installed it using the procedure for installing from archive at
Download and install Nextcloud -
Are you using CloudfIare, mod_security, or similar?
-
No
Summary of the issue you are facing:
I use the steps described in
Steps to replicate it (hint: details matter!):
-
Install proton bridge Version: 3.19.0
-
Successful send/receive using it on the web browser and also nextcloud users on the server send/receive emails no problem.
-
I then use the steps described in Email — Nextcloud latest Administration Manual latest documentation
This step follows the same steps as what is used for the nextCloud user to send receive emails using nextcloud mail app 4.3.5 successfully. -
During the send test I get error back: AxiosError: Request failed with status code 400
-
Turn smtp debugger mode on nextCloud and find the errors noted in the debug output logs below
Log entries
Nextcloud
{"reqId":"o5Tu1EUORph1VS8RiDFj","level":0,"time":"2025-04-05T04:47:13+00:00","remoteAddr":"192.168.50.100","user":"cloud","app":"no app in context","method":"POST","url":"/settings/admin/mailtest","message":"Email transport \"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport\" starting","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"30.0.8.1","data":[]}
{"reqId":"o5Tu1EUORph1VS8RiDFj","level":0,"time":"2025-04-05T04:47:13+00:00","remoteAddr":"192.168.50.100","user":"cloud","app":"core","method":"POST","url":"/settings/admin/mailtest","message":"Sending mail to \"Array\n(\n [support@johnster-inc.com] => cloud\n)\n\" with subject \"Email setting test\" failed","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"30.0.8.1","exception":{"Exception":"Symfony\\Component\\Mailer\\Exception\\TransportException","Message":"Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed","Code":0,"Trace":[{"function":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\{closure}","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\SocketStream","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/Stream/SocketStream.php","line":174,"function":"stream_socket_enable_crypto"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/EsmtpTransport.php","line":152,"function":"startTLS","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\SocketStream","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/EsmtpTransport.php","line":118,"function":"doEhloCommand","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\EsmtpTransport","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":254,"function":"executeCommand","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\EsmtpTransport","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":277,"function":"doHeloCommand","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":210,"function":"start","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/AbstractTransport.php","line":69,"function":"doSend","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php","line":137,"function":"send","class":"Symfony\\Component\\Mailer\\Transport\\AbstractTransport","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/mailer/Mailer.php","line":42,"function":"send","class":"Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport","type":"->"},{"file":"/var/www/nextcloud/lib/private/Mail/Mailer.php","line":205,"function":"send","class":"Symfony\\Component\\Mailer\\Mailer","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/MailSettingsController.php","line":148,"function":"send","class":"OC\\Mail\\Mailer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"sendTestMail","class":"OCA\\Settings\\Controller\\MailSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":303,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1010,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/symfony/mailer/Transport/Smtp/Stream/SocketStream.php","Line":171,"message":"Sending mail to \"Array\n(\n [support@johnster-inc.com] => cloud\n)\n\" with subject \"Email setting test\" failed","exception":{},"CustomMessage":"Sending mail to \"Array\n(\n [support@johnster-inc.com] => cloud\n)\n\" with subject \"Email setting test\" failed"}}
{"reqId":"o5Tu1EUORph1VS8RiDFj","level":0,"time":"2025-04-05T04:47:13+00:00","remoteAddr":"192.168.50.100","user":"cloud","app":"core","method":"POST","url":"/settings/admin/mailtest","message":"< 220 127.0.0.1 ESMTP Service Ready\r\n> EHLO [redacted server name]\r\n< 250-PIPELINING\r\n< 250-8BITMIME\r\n< 250-ENHANCEDSTATUSCODES\r\n< 250-CHUNKING\r\n< 250-STARTTLS\r\n< 250-AUTH PLAIN LOGIN\r\n< 250 SIZE\r\n> STARTTLS\n< 220 2.0.0 Ready to start TLS\r\n","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36","version":"30.0.8.1","data":{"app":"core"}}
Web server / Reverse Proxy
The only output generated is not an error and is noted in /var/log/nginx/access.log
192.168.50.100 - - [04/Apr/2025:22:55:14 -0600] "POST /settings/admin/mailtest HTTP/2.0" 400 135 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
Configuration
The credentials used below are same as what is used by email users that works successfully
'verify_peer_name' => false,
'allow_self_signed' => true,
'verify_peer' => false,
'mail_from_address' => 'support',
'mail_smtpmode' => 'smtp',
'mail_domain' => "***REMOVED SENSITIVE VALUE***",
'mail_smtphost' => '127.0.0.1:1025',
'mail_smtptimeout' => 30,
'mail_smtpauth' => true,
'mail_smtpname' => "***REMOVED SENSITIVE VALUE***",
'mail_smtppassword' => "***REMOVED SENSITIVE VALUE***",
Nextcloud
The output of occ config:list system
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"edee.johnster-inc.com"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "30.0.8.1",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"theme": "",
"loglevel": 0,
"mail_smtpdebug": true,
"maintenance": false,
"enabledPreviewProviders": [
"OC\\Preview\\Image",
"OC\\Preview\\HEIC",
"OC\\Preview\\TIFF",
"OC\\Preview\\Movie"
],
"preview_max_filesize_image": 80000,
"memories.vod.disable": false,
"memories.vod.ffmpeg": "\/usr\/bin",
"memories.vod.ffprobe": "\/usr\/bin",
"memories.db.triggers.fcu": true,
"memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
"memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
"verify_peer_name": false,
"allow_self_signed": true,
"verify_peer": false,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtptimeout": 30,
"mail_smtpauth": true,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"cloud_url": "***REMOVED SENSITIVE VALUE***",
"preview_max_memory": 512,
"app_install_overwrite": [
"epubreader"
]
}
}
Apps
The output of occ app:list
(if possible).
Enabled:
- activity: 3.0.0
- admin_audit: 1.20.0
- announcementcenter: 7.1.0
- app_api: 4.0.6
- appointments: 2.4.3
- assistant: 2.4.0
- audioplayer: 3.4.1
- bruteforcesettings: 3.0.0
- calendar: 5.2.0
- call_summary_bot: 2.0.1
- circles: 30.0.0
- cloud_federation_api: 1.13.0
- cloud_py_api: 0.2.0
- collectives: 2.16.1
- comments: 1.20.1
- contacts: 7.0.4
- contactsinteraction: 1.11.0
- context_chat: 4.2.0
- dashboard: 7.10.0
- dav: 1.31.1
- deck: 1.14.4
- end_to_end_encryption: 1.16.2
- epubviewer: 1.7.2
- event_update_notification: 2.6.1
- federatedfilesharing: 1.20.0
- federation: 1.20.0
- files: 2.2.0
- files_3dmodelviewer: 0.0.15
- files_accesscontrol: 1.20.1
- files_automatedtagging: 1.20.0
- files_downloadlimit: 3.0.0
- files_pdfviewer: 3.0.0
- files_reminders: 1.3.0
- files_sharing: 1.22.0
- files_trashbin: 1.20.1
- files_versions: 1.23.0
- firstrunwizard: 3.0.0
- gpxpod: 7.0.4
- groupfolders: 18.1.2
- imageconverter: 2.0.4
- keeweb: 0.6.21
- limit_login_to_ip: 4.2.0
- logreader: 3.0.0
- lookup_server_connector: 1.18.0
- mail: 4.3.5
- maps: 1.5.0
- mediadc: 0.4.0
- memories: 7.5.2
- music: 2.1.3
- news: 25.3.1
- nextcloud_announcements: 2.0.0
- notes: 4.11.0
- notifications: 3.0.0
- oauth2: 1.18.1
- ownershiptransfer: 1.1.0
- password_policy: 2.0.0
- phonetrack: 0.8.2
- photos: 3.0.2
- previewgenerator: 5.8.0
- privacy: 2.0.0
- provisioning_api: 1.20.0
- quota_warning: 1.21.0
- recognize: 8.2.0
- recommendations: 3.0.0
- related_resources: 1.5.0
- root_cache_cleaner: 0.1.8
- secrets: 2.1.2
- serverinfo: 2.0.0
- settings: 1.13.0
- side_menu: 4.1.1
- socialsharing_diaspora: 3.3.0
- spreed: 20.1.5
- support: 2.0.0
- survey_client: 2.0.0
- suspicious_login: 8.0.0
- systemtags: 1.20.0
- tasks: 0.16.1
- text: 4.1.0
- theming: 2.6.0
- twofactor_backupcodes: 1.19.0
- twofactor_nextcloud_notification: 4.0.0
- updatenotification: 1.20.0
- user_status: 1.10.0
- user_usage_report: 1.14.0
- viewer: 3.0.0
- weather_status: 1.10.0
- webhook_listeners: 1.1.0-dev
- workflow_media_converter: 1.13.5
- workflowengine: 2.12.0
Disabled:
- encryption: 2.18.0 (installed 2.16.0)
- epubreader: 1.4.7 (installed 1.4.7)
- files_external: 1.22.0
- sharebymail: 1.20.0 (installed 1.20.0)
- twofactor_totp: 12.0.0-dev
- user_ldap: 1.21.0
Thank you in advance for reviewing all this as an effort to help with a solution. This is not a blocker for me at this point but any help to solve would be appreciated.
Update on 4/5
The error log indicates the failure occurs during certificate verification:
Message":"Unable to connect with STARTTLS: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:0A000086:SSL routines::certificate verify failed","Code":0
So i also added the following line to /var/www/nextcloud/config/config.php
'mail_smtpsecure' => '',
But the error remained the same.
I understand it can not be enforced by nextcloud to ignore it as described in the documentation:
mail_smtpsecure
‘mail_smtpsecure’ => ‘’,
This depends on mail_smtpmode. Specify ssl when you are using SSL/TLS. Any other value will be ignored.If the server advertises STARTTLS capabilities, they might be used, but they cannot be enforced by this config option.
Defaults to ‘’ (empty string)
This is a localhost connection from nextcloud to the Proton Bridge, so yes, certificate checking is not required.
How can I bypass the certificate checking to overcome this error?
(The certificates are valid but not needed in this case)