Netmail 5.x with Office 365 and Powershell
To inject into Office 365, the global admin accounts used must be granted impersonation rights through remote powershell. To do this, these commandlets must be downloaded from the MSOLSERVICE server. When attempting to connect using "Connect-MsolService" the Powershell session generates an error "Could not establish trust relationship for the SSL/TLS secure channel with authority 'provisoningapi.microsoftonline.com'.
There should be a trust relationship established between customer domain and O365 domain, however if you have logged into the server/worksation as a local user and are running those powershell commands, that trust relationship is not present. Login as an AD user to the workstation/server and rerun the commands in Powershell.