Problem while sending email - pls review your settings / Beim Senden der E-Mail ist ein Problem aufgetreten. Bitte überprüfe Deine Einstellungen. (Fehler: Unable to connect with TLS encryption)

Support intro

Hi,

using Hetzner’s preconfigurated nextcloud image.
the only thing I changed in the SSL Certificate. Using Comodo Positive wildcard certificate now.

tried to configure email-settings with Login-Data which is working fine for Thunderbird, but I always get the message “Unable to connect with TLS encryption”

searched already this forum but none of the provided solution did help for me…

any help appreciated.

thx,
reisetroll

Nextcloud version 15.0.2
Operating system and version Ubuntu 18.04.1 LTS
Apache or nginx version Apache/2.4.29 (Ubuntu)

PHP version PHP 7.2.10-0ubuntu0.18.04.1

Is this the first time you’ve seen this error? Y:

Steps to replicate it:

  1. configure Mail with SMTP, STARTTLS and normal LOGIN
  2. try to send test mail

The output of your Nextcloud log in Admin > Logging:
Error PHP stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed at /var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php#94
2019-01-14T09:54:14+0100

/etc/apache2/sites-available/nextcloud.conf
Alias /nextcloud “/var/www/nextcloud/”
ServerName nextcloud.xxxxxxxx.at

<Directory /var/www/nextcloud/>
_ Options +FollowSymlinks_
_ AllowOverride All_

_ _
_ Dav off_
_ _

_ SetEnv HOME /var/www/nextcloud_
_ SetEnv HTTP_HOME /var/www/nextcloud_

Header always set Referrer-Policy no-referrer

/etc/apache2/sites-available/default_ssl.conf

ServerAdmin webadmin@xxxxxxxxxxx.at ServerName nextcloud.xxxxxxxxxxx.at DocumentRoot /var/www/nextcloud
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	SSLEngine on

SSLCertificateKeyFile /etc/ssl/private/STAR_xxxxxxxxxxx.at.key
SSLCertificateFile /etc/ssl/certs/STAR_xxxxxxxxxxx_at_bundle.crt
SSLCertificateChainFile /etc/ssl/certs/STAR_xxxxxxxxxxx_at.bundle

	<FilesMatch "\.(cgi|shtml|phtml|php)$">
			SSLOptions +StdEnvVars
	</FilesMatch>
	<Directory /usr/lib/cgi-bin>
			SSLOptions +StdEnvVars
	</Directory>


	<IfModule mod_headers.c>
			Header always set Strict-Transport-Security "max-age=15768000; preload"
                            Header set Referrer-Policy "no-referrer-when-downgrade"
	</IfModule>
</VirtualHost>

@reisetroll

thanks for your posting. but as this is an international forum we’re trying to keep it international. thus i roughly translated the title of your thread to english. feel free to correct and/or adjust it.

pls take note of it since otherwise we need to move your german postings to the geman (sub-)thread.

If that messages was logged at the time you tried to send a mail, I’d suppose that the certificate of the mail server is not valid (self-signed, wrong hostname, …). There are tools to check the mail server:
https://www.checktls.com
Or via command line, let me know if you can’t google it yourself.

Hi, I’m having the same problem without a solution: Gmail SMTP Email Server config

back in December I installed the newest 15 version from the scratch (Ubuntu, Nginx, MariaDB, PHP) in a test server just to see how it looks and I didn’t have that issue reproducing exactly the same exactly the same configuration using Gmail and the same Letsencrypt certificate for my domain and it worked perfectly, there must be some thing from Ubuntu side that I cannot still figure out.

In my production environment I installed from the scratch Ubuntu 16.04 with Nextcloud 13 and the upgraded to 18.04 and NC 14 then afterwards to 15 and the issue is still there…

yes, the certificate is self-signed.

I would have a COMODO wildcard-certificate for my domain.

would it be enough to exchange the ssl cert in the postfix config?

thanks!

@JimmyKater thanks for translating, that happens when you’re starting a post in one language and do the rest in another one… :wink:

got a solution now!

changed ssl_cert & ssl_key in /etc/postfix/main.cf to my own bought wildcard-certificate. Sending emails through nextcloud is working now for me :slight_smile: