Smtp with starttls - lost connection after STARTTLS

has anybody experience with the mail connection through smtp in 10.3?

I am trying to connect through smtp with starttls to a central mailserver in the same network (but not locally on the OC server). Settings are:

send mode: smtp
encryption: starttls
server address (587 = submission port RFC 6409)
username & Password
authentcation method: none

I always get:

Nov 27 18:49:57 mail2 postfix/submission/smtpd[1013]: connect from unknown[]
Nov 27 18:49:57 mail2 postfix/submission/smtpd[1013]: lost connection after STARTTLS from unknown[]
Nov 27 18:49:57 mail2 postfix/submission/smtpd[1013]: disconnect from unknown[] ehlo=1 starttls=1 commands=2

Same happens when I use the standard port 25. I also played with ‘mail_smtptimeout’ => ‘30’ but without success.

Any ideas? Both servers are located in the same network segment, but are separated from each other, therefore I need smtp and can not use local sendmail instead.


I didn’t have any problem setting it, my SMTP (only port 25) server also is on an other machine.

  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'mx.domain.example',
  'mail_smtpport' => '25',
  'mail_domain' => 'my.domain.example',
  'mail_from_address' => 'no-reply',

You should check with netcat, or telnet that you can send an email from you ownCloud machine through your SMTP, it’s maybe a SMTP configuration problem rather than an ownCloud one.
Good luck.

1 Like

Are you using a self-signed certificate on your mail server? I recently found out that it’s impossible to connect with a mail server that is using a self-signed cert.

If you set 'mail_smtpdebug' => true, in your config.php you should see the following error when using a self-signed cert:

SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed 

I recommend to use the tool swaks on the ownCloud server command line to check whether your email server supports STARTTLS. Once you have confirmed that it works through swaks you can try to replicate the settings in your ownCloud.


1 Like

Hi all,
Thanks for your hints for debugging. The smtp server uses starttls already and a real certificate (letsencrypt). I will do some more debugging …

The logging option could still be useful for debugging. Do you get an error message when sending a test email in the WebUI?

1 Like

The solution was simple: I used a local interface ( to connect to the smtp server instead of the official dns name. This, together with a missing map entry for the sending mailadress (owncloud-noreply@) lead to the error. Now it works - thanks again :wink: