E-mail to SMS with Sendmail and Authentication

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


In this setup we assume there are multiple organizations and each has it's own Sendmail server. The users send e-mails form Windows Mail through these servers. The Sendmail 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 Sendmail servers

Email to sms with Sendmail (Video tutorial)

In this video, you will learn how to setup a system that forwards emails to sms message with sendmail. The video will start with setting up a new smpp client and will end with adding smtp users. This video is only a little more than 2 minutes long and it is easy to understand. The software used in this video is the Ozeki SMS Gateway which is the perfect choice for building an email forwarding system.

SMTP authentication

You need to configure an header check rule in Sendmail 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)

Figure 2 - 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 3). 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 Sendmail.

ozeki sms gateway e-mail header authentication
Figure 3 - Ozeki E-mail header authentication

SMTP authentication in Sendmail

In this video, you will learn how to configure sendmail. It will start with adding the ozeki SMS gateway’s domain as a smart host and will end with adding the sms gateway authentication header in sendmail. This video in only a little more then a minute long and easy to follow. You will have no problem completing the process. After this video, you will have working email to sms from sendmail system.

Step 1: Add the Ozeki SMS Gateway's domain as Smart host in the Sendmail configuration file.

Step 2: To add the SMS gateway authentication header in Sendmail, you must add H Configuration Command in the Sendmail configuration file. In this command, you should add a message header field to "x-ozeki-auth: username; password". In our case the username is client1 and the password is puma123 (Figure 3).

add custom header to Sendmail
Figure 4 - Add custom header to Sendmail

Testing the solution

You can test this solution by sending an e-mail message from Windows Mail through Sendmail. 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 sendmail server.

The e-mail you send from Windows Mail will go to your Sendmail server. Sendmail 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 SMS Gateway logs (Video 3).

Testing the system (Video tutorial)

In this video, you will learn how to test your email to sms with sendmail system. It will start with sending a new message and will end with the log of the sent message. In the Events tab of the Ozeki SMS Gateway, you will find the records of all the events in the connection. This video is 1 and a half minutes long. It is very detailed but easy to understand.


As you could see in the guide, the E-Mail to SMS technology using Sendmail with the help of Ozeki SMS Gateway is the perfect solution if you manage different organizations and want to send out converted SMS to your customers. Sendmail and Ozeki SMS Gateway work together to complete the conversion and distribution. Ozeki SMS Gateway's Ozeki E-mail header authentication is a proper tool in the distribution process, it makes sure that the messages are delivered to the right recipients. This is a fast working, easy to set up solution in messaging between different platforms.

If you followed every step carefully above, you are able to forward E-Mail messages as SMS to mobile users. Ozeki SMS Gateway works in any country, so if a connection has to be set up abroad, it will be done just like any other network.

Make sure to read more about E-Mail to SMS technologies, such as Gmail and Winmail.

Your only thing to do is to download Ozeki SMS Gateway and start working now!

More information