E-mail to SMS with Exchange and Authentication

This document explains how you can setup an E-mail to SMS service to serve multiple Exchange 365 servers. This setup is useful if you provide SMS service to your customers and each customer has their own Exchange 365 server. The configuration explains how you can create accounts for each customer, and how your customers can use their username and passwords in Exchange to send SMS through your service. The document also shows how you can use SSL/STARTTLS encryption to encrypt traffic between your customer's Exchange server and your Ozeki SMS Gateway. This is necessary to protect your usernames and passwords.

Introduction

In this setup we assume there are multiple organizations, and each has its own Exchange 365 server. The users send e-mails form Outlook through these servers. The Exchange servers capture the e-mails going to a specific domain and forward these e-mails to the Ozeki SMS Gateway. The Ozeki SMS Gateway converts the e-mails into SMS and sends them out (Figure 1).

Figure 1 - E-mail to SMS to serve multiple Exchange servers

SMTP authentication

Unfortunately, the Exchange 365 connectors do not offer SMTP authentication. To overcome this, you need to configure an Exchange rule to add the Ozeki Authentication header to the e-mail. You also have to configure the SMTP server in Ozeki to use this authentication header to determine which user the E-mail belongs to. (Figure 2 and Figure 3)

Figure 2 - Email header authentication

Figure 3 - Email header authentication

SMTP authentication in Ozeki

To configure the built in SMTP server of Ozeki to accept the username and password in the e-mail header, you must select the "Ozeki E-mail header authentication" option in the SMTP server configuration (Figure 4). The header field expected will be "x-ozeki-auth: username; password". This header field is appended to each email forwarded to the SMS gateway from exchange.

Video 1 - How to configure Ozeki SMS Gateway to use x-ozeki-auth header authentication (Video tutorial)

Figure 4 - Configure E-mail header authentication in Ozeki SMS Gateaway

SMTP authentication in Exchange 365

To add the SMS gateway authentication header in Exchange, you must add a new rule. In this rule, you should filter for the domain in the recipient address. In our case the filter is set to "sms2.gw", and you must set a message header field to "x-ozeki-auth: username; password". In our case the username is client1 and the password is puma123 (Figure 5).

Video 2 - How to configure Exchange with Ozeki x-ozeki-auth header authentication (Video tutorial)

Figure 5 - Add the Ozeki auth header to exchange

If the set header option is not available in your form, you need to click on the More options link in the bottom left-hand side of the form. This will add the necessary fields to the combo box. (Figure 6)

Figure 6 - Click more options

Testing the solution

You can test this solution by sending an e-mail message from Outlook through Exchange. When you send the e-mail you must provide the recipient e-mail address in +44123467@sms2.gw format, where +44123467 should be replaced to the SMS phone number you wish to send your message to and sms2.gw should be the domain you have setup in your exchange server.

The e-mail you send from Outlook will go to your Exchange server. Exchange will first append the x-ozeki-auth headers to it, then it will forward it to the SMS gateway using the connector we have setup up.

Next the e-mail will come in to the built in SMTP Server of Ozeki SMS Gateway. The SMTP server will select the appropriate user based on the e-mail header and will forward the messages to it. Next Ozeki SMS gateway will convert this e-mail into SMS and will send it through a mobile network connection. You can follow the message's path in the Ozeki NG SMS Gateway logs (Video 3).

Video 3 - The path of the E-mail in Ozeki NG SMS Gateway (Video tutorial)

More information