Issue with owncloud and exchange server

Steps to reproduce
1. Configure working owncloud server, https etc.
2. attempt to set up smtp tls mail with exchange 2010/2013
3. ensure selinux has httpd sendmail on, ensure exchange has relay open for known owncloud server IP

Expected behaviour
Tell us what should happen
owncloud should relay mail through exchange 2013 server

Actual behaviour
Tell us what happens instead
owncloud fails to test sending mail when working with any permutation of relevant smtp send settings (25, 465, 587, 993 etc.). neurotically verified that any combination of u/auth does not work on any port, IP or FQDN. note that even my xerox copiers on site work with the exchange server over the same protocols (and several other IIS webservers for that matter).
Server configuration
Operating system: CentOS 7
Web server: apache/httpd
Database: mariadb
PHP version: 7
ownCloud version (see ownCloud admin page): 9.04
Updated from an older ownCloud or fresh install: fresh (prince of bel-air)
Special configuration (external storage, external authentication, reverse proxy, server-side-encryption): external auth - yes - ldap working 100%

ownCloud log (data/owncloud.log)

Please paste possible errors in the following code block, see for more info

A problem occurred while sending the email. Please revise your settings. (Error: Unable to connect with TLS encryption)

Integrity status for oC9+

No errors have been found.

Noting all of the above - does anyone have settings/config suggestions or a centos settings I may be missing? I've verified that selinux has been calmed down on sendmail for httpd, but perhaps there is something else I am not aware of blocking it. Perhaps firewallcmd that I need to run?


without the used SMTP settings in your config.php its hard to help here. It might be also interesting to know if you're using a valid SSL cert on the exchange server.

Sure, but note that I have edited these settings a hundred times in different combinations in an attempt to have it auth to the exchange server.

'mail_from_address' => 'user',
'mail_smtpmode' => 'smtp',
'mail_domain' => '',
'mail_smtphost' => '',
'mail_smtpport' => '587',
'mail_smtptimeout' => 10,
'mail_smtpauth' => 1,
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpname' => 'user',
'mail_smtppassword' => 'password',
'ldapIgnoreNamingRules' => false,
'mail_smtpdebug' => true,
'mail_smtpsecure' => 'tls',

SSL cert is valid for (edit) also valid cert for on exchange

Ok, you might want to read into the troubleshooting docs available here:

The general documentation has also some additional examples:

Could be also possible that the documentation there is outdated as the Mail Library used by ownCloud was replaced by SwiftMailer but the docs there where not touched since ages.

Those here might also help:

On the second link someone has written that downgrading from PHP 5.6 to 5.5 did the job.

Here someone is talking about removing a restriction at the MTA itself: