SendGrid tells me I need a reseller account, and Postmark won't let me send newsletter-style messages; so it's time to try Amazon's Simple Email Service. All I need is a big machine that takes care of delivering mail, the rest is fluff.
I'm using drewblas/aws-ses. Somewhere between ActionMailer and AWS::SES, errors are swallowed and your application fails to let you know that emails aren't getting sent. By the time I had broken the "fetch mail" button on my mail client, it was time to run
rails console on the server to figure out what was going on:
$ RAILS_ENV=staging rails console Loading staging environment (Rails 3.0.3) irb(main):001:0> require "aws/ses" false irb(main):003:0> ses = AWS::SES::Base.new :access_key_id => "your_access_key", :secret_access_key => "not_telling_you" => #<AWS::SES::Base:0x7fd3607d0308 etc... > irb(main):003:0> ses.send_email :to => ['firstname.lastname@example.org'], :source => 'email@example.com', :subject => 'Testing', :text_body => 'Yes, testing!' AWS::SES::ResponseError: AWS::SES Response Error: RequestExpiredRequest timestamp: Mon, 14 Feb 2011 10:13:32 GMT expired. It must be within 300 secs/ of server time.
It turns out that my server's clock was racing into the future. I like how Slicehost moves fast, but I wasn't expecting observable relativistic effects. My server was 8 whole minutes ahead of the rest of the world. If I wasn't busy building my cool new site I could have used it to game the stock market or something wicked like that ...
Anyway, thanks to Code Ghar here's the solution:
$ date Mon Feb 14 10:16:24 UTC 2011 $ sudo ntpdate pool.ntp.org 14 Feb 10:08:55 ntpdate: step time server 126.96.36.199 offset -639.622800 sec $ date Mon Feb 14 10:09:01 UTC 2011