GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
We had some complaints that emails were cut off from the middle. After a while of debugging we realized that content column is saved as text. Mysql text takes only 64kb. (http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html)
64kb can be easily reached with a longer html message. And its definitely is reached if you have any attachments.
I guess Postgresql has no limit?
Force longtext column in mysql. Change following line to migration
t.text :content, :limit => 100.megabytes # limit is number of characters, not actually bytes
Rails sql handler will use the right columns depending on the sql server. So it should work with Postgresql etc. 100.megabytes is just a random good big number as a limit. We are using utf8 chars in db so 100 megabytes is actually multiplied by three.
Also readme.md could have some info:
Generate default initializer and migration files: `rails generate mailhopper`.
Default max-size for content is quite large. Depending on your needs
and sql server you can modify the migration.
Btw, thanks for the gem, has helped a lot :)
Sorry to hear that this gave you trouble. We've only been using mailhopper with relatively small emails, so we hadn't yet encountered this limit.
I agree with your recommendations and implemented them in the latest version of mailhopper: 0.0.9.