paveltyk / sendgrid-rails

SendGrid extensions to Rails 3 ActionMailer::Base
http://paveltyk.github.com/sendgrid-rails/
73 stars 23 forks source link

Add spaces to X-SMTP header #3

Closed ignovak closed 12 years ago

ignovak commented 12 years ago

Hi

Sending emails to large number of recipients I've encountered such error:

A message was received from this address by our systems that had errors in the smtpapi header, and cannot be processed. The error detected was: Error decoding SMTP API header

The reason was in X-SMTP header, which was too large and was not broken down with spaces properly. The way how to avoid this problem is described here: http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/

This pull-request adds spaces to header, so problem seems to be resolved. There is one drawback there that header size increases 1.5 times. You can probably find better solution.

Thanks

gtd commented 12 years ago

I'm migrating from the sengrid gem to this one which appears much better designed, and I'm about to start sending emails in batches of 1000. This looks like a legitimate problem that I'd rather solve before I get burned in production. Any comment on merging this down Pavel? I'd be willing to contribute to a better solution if you want.

gtd commented 12 years ago

Alright I see this pull request is broken, working on a proper solution now.

paveltyk commented 12 years ago

Thank you for help. Released v2.0.2 with fix for this issue.