TurboGears / backlash

Standalone WebOb port of the Werkzeug Debugger with Python3 support born as a WebError replacement for TurboGears2
MIT License
13 stars 11 forks source link

Large exception bodies result in empty email subject lines #15

Closed chrismacklin closed 5 years ago

chrismacklin commented 5 years ago

For exceptions whose message is quite long, I end up with emails with no subject at all instead of a truncated subject body. Happy to submit a patch to fix this behavior. Looks like this library already replaces newlines with spaces, but RFC2822 section 2.1.1 suggests a practical hard limit at 998 characters. If you agree with this implementation, I will submit a patch that truncates all email subjects to this limit, potentially adding a trailing ellipsis or other indicator that the subject has been truncated.

amol- commented 5 years ago

Yes please, I'll gladly accept any patch that truncates the outgoing email subject. That should probably happen here: https://github.com/TurboGears/backlash/blob/master/backlash/tracing/reporters/mail.py#L110

chrismacklin commented 5 years ago

I don't have a reproduction of this error to contribute and I'm about to leave the job that is now using this library, so the chances of me fixing this are low. I'm closing this issue.