Tuesday, January 25, 2011

How to separate transactional email into separate JangoSMTP accounts when sending from a single IP address

Over the year and a half since we launched JangoSMTP, we've had a handful of clients come to us with a unique setup request that we were unable to accommodate -- until now. We had some agency type users that were setting JangoSMTP up on behalf of their clients. They wanted to authenticate into the SMTP service by IP address, because their system didn't allow them to use SMTP AUTH. However, since they were coordinating transactional email on behalf of multiple clients, they wanted the different emails to go into different JangoSMTP accounts, even though all email would be sent from the same single IP address.

This is now possible with a custom header that will force JangoSMTP to assign an email to a particular account:

X-SMTPUsername: TheAccountUsername

If you include this header in each email message, then the message will be assigned to the JangoSMTP account with the username designated in the header, regardless of the IP address from which it is sent. The sending IP address would still need to be added to one of the JangoSMTP accounts, but it wouldn't matter which account.

For example, let's say you're a web development agency, and you have five clients, and you host all five of your clients' web sites on a shared server with a single IP address. You might create five JangoSMTP accounts with the usernames:

  1. BrownieKitchen
  2. CookieMonsterCo
  3. PizzaFactory
  4. ScoopOfCream
  5. ChickenChaCha
You would add the IP of the shared web server to any one of the five accounts -- it doesn't matter which one. But, for each transactional email sent through the SMTP relay service, you would include the header:

X-SMTPUsername: PizzaFactory

to assign that email to the PizzaFactory account, for example.