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 https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808 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?

Hi,

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' => 'domain.com',
'mail_smtphost' => '10.100.0.122',
'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 https://owncloud.domain.com/ (edit) also valid cert for mail.domain.com on exchange

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

https://doc.owncloud.org/server/latest/admin_manual/configuration_server/email_configuration.html#troubleshooting

The general documentation has also some additional examples:

https://doc.owncloud.org/server/latest/admin_manual/configuration_server/email_configuration.html#ssl
https://doc.owncloud.org/server/latest/admin_manual/configuration_server/email_configuration.html#tls

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:

https://www.mautic.org/community/index.php/3426-unable-to-connect-with-tls-encryption/p1#p16046