It's preferable for Ubersmith-related email to be handled by the local mail container rather than communicating directly with a remote SMTP host. Mail delivery is quicker, with superior logging, and avoids the need for the Ubersmith web interface to 'pause' or 'wait' for the mail delivery actions to complete. Ubersmith's mail container runs the Postfix MTA. This configuration is confirmed to work with Office 365, Sendgrid, and Amazon SES.
The following instructions assume that Ubersmith has been installed to /usr/local/ubersmith and that Ubersmith is being configured to relay mail to Office 365. Be sure to use the specific relayhost configuration for the provider you plan to have Ubersmith send mail to. Retrieve the latest copy of cacert.pem from curl.haxx.se and place it in /usr/local/ubersmith/conf/mail:
curl -L -Ohttps://curl.haxx.se/ca/cacert.pem
Open a shell within the mail container:
docker-compose exec mail bash
Within the mail container, modify /etc/postfix/main.cfto uncomment and edit the following variables to the appropriate settings: