Postal: Configurable Message Size Limit

Created on 12 Jul 2017  路  7Comments  路  Source: postalhq/postal

Hi there,

first, many thanks for your great project - it's awesome :)
Sometimes we need to send emails with very large attachments (about 50MB) over postal.
They fail at the moment with the message: 552 Message too large (maximum size 14MB)

It seems, that postal has a hardcoded limit of 14MB, is that correct?

screen shot 2017-07-12 at 21 30 57

It would be awesome, if this limit can be configured over the interface or the config file (postal.yml).
What do you think?

Many thanks and best regards
Reto

enhancement

Most helpful comment

I really don't see any reason why we can't just change the column type in the table creation code and change the limit.

All 7 comments

That's correct. At present, that is limited by the size of the data column on the database that stores raw messages. To allow this to be configurable, the raw message table will need to be able to overflow data into new rows. This is something we'd like to add one day so I'll mark this as an enhancement.

Hi @adamcooke

Is there a way to workaround the issue (for example not to store the message in the DB)?

Thanks!

Or possibly switch to LONGBLOB as column type which supports up to 4GB (https://stackoverflow.com/a/5775601/1580028).

Which probably has a whole host of implications on itself, but could be made in a configurable setting maybe...

I really don't see any reason why we can't just change the column type in the table creation code and change the limit.

Mind sharing where that "table creation code" is located at ?
Thanks !

https://github.com/atech/postal/blob/master/lib/postal/message_db/provisioner.rb#L85

Changing mediumblob to longblob will allow messages up to 4GB to be stored in all newly created data tables (ie starting the next day).

The validation here will then need to be made configurable:

https://github.com/atech/postal/blob/master/lib/postal/smtp_server/client.rb#L380

This is actually a really trivial change. Feel free to try it and submit a pull request.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

broskees picture broskees  路  4Comments

oasis1234 picture oasis1234  路  5Comments

wassimseif picture wassimseif  路  7Comments

shravin picture shravin  路  5Comments

shinebayar-g picture shinebayar-g  路  3Comments