Mail-in with large file results in cryptic "Error parsing email" PM to admins, fails silently to sender


(Tobias Eigen) #1

I get the PM below as admin when attempting to send a large file via email to a forum category. I can understand that it fails and want it to fail, but the error reporting is not working well. The admins get just this “error parsing email” PM with “Error - ActiveRecord::Rollback”. In the logs, I see there are some “cannot allocate memory” errors which I gather are related to this task. The sender of the email gets nothing.


Add link to commit on GitHub when closing a fixed bug/added feature
(Jeff Atwood) #2

How large is the file?


(Tobias Eigen) #3

16MB! So yes, an absurdly large file. :slight_smile: And I want it to fail, but I do expect some sort of error message by reply email and in the logs.


(Jeff Atwood) #4

Kind of an extreme case. Where do you “log” a 16MB message?

And actually larger since attachments are base64 encoded (binary-to-plaintext) in email – 1.33 times larger or 21.3 MB.


(Tobias Eigen) #5

I don’t disagree that this is an extreme case… but since it’s possible to send emails with large attachments people will do it, and any mail system should handle any email one way or another. It should not just disappear in the ether.


(Wes Osborn) #6

I agree. There are other instances where this happens with in Discourse as well: user attempts to email into a category they don’t have permissions to post into, unregistered user attempts to send an email into a category email inbox.

Generally speaking, we’d like any time an inbound email doesn’t successfully create a new topic or update a thread that a message was sent back to the sender letting them know that their message wasn’t posted successfully and offer them some remedies or other options/actions.


Should not receive emails for your own messages
(Jeff Atwood) #7

The remedy in this case would be “submit a pull request to an open source software project to help advance the extremely complex case of parsing every known email format”.

Is that really what you want to tell your users?


(Wes Osborn) #8

I was thinking something less drastic for the time being.

More along the lines of “We’re sorry we couldn’t process your message, could you please try submitting the message using the online tool [link to Discourse website]”.


(Jeff Atwood) #9

Definitely a good idea, and will keep that in mind, we’ll be doing some more email work with a new customer soon.


(Wes Osborn) #10

Excited to hear that there might be some changes coming soon.

For a site with thousands of active mostly web forum users, “losing” an inbound email message everyone once in awhile is no big deal. For sites like ours with a few hundred users and only a few dozen really active ones (most of them are active via email), having a message disappear on them can give them a very negative view of the community.

This video would sum up how we feel about each email coming into our community:


(Jeff Atwood) #11

Courtesy of @riking we have MUCH better error responses for email, many with specific messages and details. It can continue to improve but it is worlds better than what we had before which was almost nothing. :trophy:


(Jeff Atwood) #12