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

RFC5322 validation prevents importing of previously-received emails #386

Open
alexforencich opened this issue Aug 5, 2023 · 7 comments
Open
Labels
bug Something isn't working

Comments

@alexforencich
Copy link

I have been running in to issues with importing old emails into proton mail via the proton mail bridge due to the RFC5322 validation. TBH, I think this validation should probably be removed completely - if emails can be received that are missing the date field and have matching from and sender fields, then it should be possible to import such a message via imap.

@LBeernaertProton LBeernaertProton added bug Something isn't working and removed bug Something isn't working labels Aug 7, 2023
@LBeernaertProton
Copy link
Contributor

We have tracked the date issue internally as GODT-2847.

@LBeernaertProton LBeernaertProton added the bug Something isn't working label Aug 7, 2023
@yu-tendo
Copy link

Any ETA? Thank you!

@LBeernaertProton
Copy link
Contributor

We currently have no ETA for this ticket. For anyone who is blocked by this, we recommend adding a Date header field to the message in question.

@alexforencich
Copy link
Author

Do you have a guide for how to edit received emails like this in thunderbird? Better yet, is there a way to automate fixing broken messages, as there several messages that trigger this problem (and cause the bulk copy operation to abort) out of thousands of messages?

@yu-tendo
Copy link

yu-tendo commented Nov 14, 2023

Thanks for the reply! @LBeernaertProton

I think this issue goes behind fixing the "Date" field. I have several different parsing issues, all related to the RFC5322 validation. I received all of these e-Mails at some point so there should be a possibility to move them (or fix them easily/quickly). Here are some example error messages:

  • invalid rfc5322 message: failed to parse From headers: [Error offset=84]: expected FWS or comment for ...
  • invalid rfc5322 message: failed to parse From headers: [Error offset=62]: expected " for quoted string ...
  • invalid rfc5322 message: failed to parse From headers: [Error offset=25]: expected : for quoted start ...
  • invalid rfc5322 message: Required header field 'From' not found or empty

Other parsing issues

  • failed to retrieve addresses for, literal: failed to parse addresses for 'Cc': [Error offset=98]: expected ...
  • failed to retrieve addresses for, literal: failed to parse addresses for 'To' [Error offset=128]: expected ...
  • illegal base64 data at input byte 306

@alexforencich
There is an add-on for Thunderbird named "Header Tools Improved". This tool can fix simple errors (e.g., you can easily edit the "date" or "from" field). I fixed some e-Mails successfully with this tool (but I have more than a hundred to fix...)

@LBeernaertProton
Copy link
Contributor

LBeernaertProton commented Nov 14, 2023

@timo-sztyler Please open a different ticket for all the issues other than invalid rfc5322 message: Required header field 'From' not found or empty as they are parsing issues, rather than validation errors.

It would be great if you could attach the relevant values of the headers for those messages. If you don't feel comfortable with the information on Github, you could always send them to my email (see commit history).

invalid rfc5322 message: Required header field 'From' not found or empty

Finally regarding this particular error, the From header field is always required to be present.

@yu-tendo
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants