Thursday, October 12, 2017

The X-Mailinator-SMTP Header

Our customers love Mailinator for email testing. Thousands of inboxes all auto-created on the fly enables some pretty unique test scenarios. Once things get going though, it's not uncommon for customers to send us many (many) thousands of emails in a short period of time.

That's great but invariably there are questions about how delivery performed. The Internet is a wild place with variability at every step. So to provide better visibility for our users, we've introduced the X-Mailinator-SMTP email header. Mailinator injects this into every email that enters the system. It looks something like this (json parsed version):

"x-mailinator-smtp": [
            "220 ESMTP Postfix;0",
            "  250-8BITMIME  250-SIZE 180000  250 Ok;90",
            "MAIL FROM:;181",
            "250 Ok;181",
            "RCPT TO:;241",
            "250 Ok;241",
            "354 End data with .;331"

You can see this on any email in the Mailinator system by viewing the email, then in the upper-right drop-down, click "json".  Subscribers will get this in the API of course starting immediately.

In every line is an event that happened in the SMTP transaction followed by a semicolon and then the number of milliseconds since the connection was open. If you know SMTP, you know that the events above starting with 3-digit integers are responses from the Mailinator server. The other capitalized commands are sent from the sender.

The "open" notes the connection open (always 0ms) and the "start" indicates when the Mailinator queue started processing (hopefully also always 0ms). It's been pretty enlightening to see the different behaviors of different emailing systems (who are you folks who wait 20s to start sending SMTP?).

We hope this feature brings our customers further visibility into the delivery of email into Mailinator.