Follow the steps below to configure Office 365 to route outbound mail through RMail Gateway:
1. Log in to the Microsoft Office 365 admin center.
2. Click Admin / Exchange / Exchange Admin Center.
3. Select Mail Flow > Connectors. All currently existing connectors for your organization will appear.
4. Click on the plus symbol (+) to add a new connector.
5. Under Select your mail flow scenario, select the following:
From: Office 365
To: Partner organization
6. Click on Next.
7. Type a name and description for the new connector.
8. Check Turn it on and click Next unless you want to create it now and turn it on later.
9. Ensure Only when email messages are sent to these domains is checked, and then click the plus (+) icon.
10. In the add domain dialog box, type a single asterisk (*) to use as a wildcard, and then click OK. This forwards your outbound email to RMail Gateway.
11. Select Route email through these smart hosts, and then click on the plus (+) icon. The smart host dialog box will appear.
12. Type the fully-qualified domain name (FQDN) of your RMail Gateway server. The FQDN is typically in the format hostname.domain.com.
13. Click on Save, and then click on Next.
14. Choose if you want to have all emails use TLS when sending to RMail Gateway, and then click Next.
15. To validate the connector, type a recipient email address on a domain outside of your organization.
16. Once the connector is successfully validated, click Save.