Mange / roadie

Making HTML emails comfortable for the Ruby rockstars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid css header in production

tylercollier opened this issue · comments

Only in production, I'm getting an invalid email header of "css". It's being set to "email", which presumably comes from my code:

default css: ["email"]

I tracked this down by setting the delivery method for emails to :file. It's not a problem in test, with delivery_method :test. This header causes Amazon's SES to reject the email with:

postfix/smtp[19321]: 5C92742976: to=<email@example.com>, relay=email-smtp.us-east-1.amazonaws.com[XXX.XXX.XXX.XXX]:587, delay=1.5, delays=0.06/0.12/0.8/0.5, dsn=5.0.0, status=bounced (host email-smtp.us-east-1.amazonaws.com[XXX.XXX.XXX.XXX] said: 554 Transaction failed: Illegal header 'css'. (in reply to end of DATA command))

I'm using commit 4d98009. I'm using Rails 4.0.0.rc2 with Ruby 2.0.0-p0, and in case it matters, the stylus gem (using the rails_4 branch).

I recognize the error. I had this in Rails 3 at the beginning of the project. I think this is a regression since upgrading to Rails 4. I still haven't tested Rails 4 myself.

Pull requests are welcome. There's a test that tries to catch this in the integration_spec.

I figured out the problem was that the gem wasn't being loaded at all. I'm not sure why, but my Capistrano deployments to production and my own manual unicorn restarts were not enough to cause the gems to be loaded (I know the Gemfile was being ignored). Manually stopping and then starting (as opposed to restarting) the unicorn server fixed it.

Btw, I ran the roadie specs (which pulled in Rails 4.0.0) and they all passed. I had already used roadie with Rails 4 successfully with another project. So good, no regressions =)

I'm glad to hear that. :-)