Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getmail command crash when receiving an email which has a long From header. #218

Open
Asayu123 opened this issue Jan 6, 2020 · 3 comments

Comments

@Asayu123
Copy link

Asayu123 commented Jan 6, 2020

Problem Summary

  • getmail command crash when receiving an email which has a long From header.

Environment

  • django-mailbox==4.8.1 + Python 3.6.3

Description

  • If decoded 'from_header' contains more than 255 characters, getmail command crashes.

Details

  • While models.Message limits the max length of from_header to 255 chars, models.Mailbox._process_message does not truncate it, and it leads to a crash.
  • msg.from_header = utils.convert_header_to_unicode(message['from'])

I came up with some plan to fix it.

  1. Remove its limit like 'to_header' field.
  2. Truncate a decoded header. (but cause a limitation that we can no longer reply that email.)

But I'm not sure which is more suitable.
Thank you in advance 😃

@FranciscoReno
Copy link

Hi @Asayu123 , I'm having the same problem you had.
Have you solved this issue? What route did you took?

@Pietro395
Copy link
Collaborator

Hi @Asayu123 , I'm having the same problem you had. Have you solved this issue? What route did you took?

Hello @FranciscoReno
Can you share the e-mail so we can test it?
You can also send it to me privately

Thank you

@pfouque
Copy link
Collaborator

pfouque commented Feb 6, 2024

Hi @FranciscoReno,
Could you manage to provide the failing message header (ideally the anonymized eml file so that we can incorporate it to the test suite)?
I'm curious to see what the header looks like and if increasing the max_length to 320 (the maximum length of an email address) would be sufficient or not.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants