Switchvox and FreePBX: Hosted email configuration options for Microsoft Office 365 and Google Workspace
The following article provides a way to configure hosted email services for different appliances. This allows the systems to send emails without needing additional user accounts and without any multi factor authentication in a simplified manner.
Â
Microsoft Office 365:
How to set up a multifunction device or application to send emails using Microsoft 365 or Office 365
To summarize look up the MX record of the domain and use that value as the relay server.
For example:
Â
Take the office domain and look up the value using a tool such as MxToolbox
Â
Take the MX value and use it in the outbound SMTP server field
Leave the username and password field empty
Set the SMTP port to 25
Set connection encryption to None
Switchvox
Â
FreePBX
Â
One caveat to this method is that messages can only be sent to addresses at the office domain which is not an issue in most cases. If you have an issue with this method contact MS 365 support and they will guide you through any issues.
Google Workspace:
Google documents the process here …
Â
The primary difference with Google Workspace is that you must define IP’s.
Below shows defined access for both Freepbx and Switchvox systems.
Note: You have an option to allow any addresses for relay or you can restrict this to addresses within your domain, in this case you are not restricted to only sending emails to other addresses within the domain .
Â
Google is more restrictive with respect to the from domain. If you encounter a failure the mail logs may report something like the following:Â
Jul 26 08:06:59 cditc postfix/smtp[22624]: 7292370: to=<cdolese@cditc.me>, relay=smtp-relay.gmail.com[142.251.15.28]:25, delay=0.19, delays=0.01/0.01/0.16/0.01, dsn=5.7.0, status=bounced (host smtp-relay.gmail.com[142.251.15.28] said: 550-5.7.0 Mail relay denied [155.138.204.24]. Invalid credentials for relay for 550-5.7.0 one of the domains in: cditc1.myskunkworks.io, myskunkworks.io (as 550-5.7.0 obtained from HELO and MAIL FROM). 550-5.7.0 Email is being sent from a domain or IP address which isn't registered 550-5.7.0 in your G Suite account. Please login to your G Suite account and 550-5.7.0 verify that your sending device IP address has been registered within 550-5.7.0 the G Suite SMTP Relay Settings. For more information, please visit 550 5.7.0Â SMTP relay service error messages - Google Workspace Admin Help g6-20020a0ce4c6000000b006370de38364sm722516qvm.1 - gsmtp (in reply to MAIL FROM command))
Â
If you encounter a failure insure your from address uses the Google Workspace domain. In the examples below the Google Workspace mail domain is http://cditc.me
Â
Switchvox
Â
FreePBX
Â
In summary these are good options for most organizations which do not require an additional account and are relatively simple to configure and debug.