If you run any sort of web app, the chances are you’ll be sending out some sort of transactional email. Whether it’s account verification, password reminders or something else most web based applications do it these days. You may have come across the problem where your perfectly nice emails get marked as spam so the end user never sees them making your application look, well, a bit unprofessional.
This is where Postmark comes in, they say that sending your transactional emails through their API can make them look better to the recieving server so they’re less likely to be marked as spam. What’s more, they even allow you to track how many emails you’ve sent and how many went into the intended recipients spam box. This promise plus the offer of 1000 free emails on registration and at only $1.5 for 1000 emails I decided to test Postmark out on a new application I was working on.
Setting up Postmark is as easy as whoever you manage your DNS through makes it! First off I signed up for a free Google apps account for my domain, this part it really straight forward. Next I signed up for Postmark account, again nice and easy. The next step was to set up the sender signatures, this is where it got tricky.
My main server is with 1&1 and so the DNS was pointed at the 1&1 name servers. I discovered that 1&1 will not let you add the required settings to the DNS, it’s a no-go. Luckily, I had registered my domains with NameCheap who do let you add TXT information to the DNS, it just takes a bit of digging to find out how so I thought I’d share it as it might help somebody.
First of all you need to make sure the DNS is with NameCheap. When you are looking at your domain in the ‘Modify Domain’ section there will be a button that says ‘Transfer DNS Back to Us’ (see below).

I saw a lot of people trying to do the next step before this one and get stuck. You won’t be able to see the button in the next step until you have done this!
Once I’d transferred the DNS back to NameCheap I needed to point the domain at my hosting so that my site still worked. You should see a new button that says ‘All Host Records’ (see below). This is the button you couldn’t see without transferring the DNS to NameCheap.

Pointing the domain at your hosting is simple. Copy the settings below but use your own IP (I’ve blurred mine out to stop people getting confused).

The top two make sure that http://yourdomain.com and http://www.yourdomain.com both point to your site. The third one points any subdomains at your site. As far as the server is concerned http://something.yourdomain.com is a different domain to http://yourdomain.com. This just points them all to the same place (this one is optional really). The fourth one just lets you use FTP on your site by going to ftp.yoursite.com.
Next we need to do the last bit, adding the SPF and DKIM values given to us in the Postmark application. As far as I know, each signature has its own values given to it by the app. You will have to log in to your account, select the correct server (you will only have one if you’re setting your first site up) and then click the ‘Sender Signatures’ link. Anyway, the codes will be something along the lines of:
v=spf1 a mx include:spf.mtasv.net ~all k=rsa; p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhALZllb8wNEhCMSNSdMXG3eL...
The top code is the SPF one and the bottom code is the DKIM one. You should still be in the ‘All host records’ section of namecheap. We’ll do the DKIM one first as that one took me longest to get right.
Under the * and ‘ftp’ subdomains add another entry. In the first box you want to type:
pm._domainkey
In the second box copy and paste the whole second line of code that Postmark gave to you (starting with k=rsa; p=MHww…). In the third box select ‘TXT Record’ and put 1800 in the TTL box.
That should do it for the DKIM. For the SPF. I put an @ symbol in the first box because it says in the legend at the bottom of the page that @ = none. Just leaving the first box blank might work for this one but I haven’t tested it, the @ worked for me.
Again in the second box paste the text from the first line of the code the app gave you. Choose ‘TXT Record’ and 1800 again and save it. That should do it, you might have to wait a little while before the app can see the changes you have made.
Here’s an image of how my finished entries look:

Also, if you have any problems head over to the Postmark support section where I found Chris to be very helpful.