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

Unhandled exception when cleaning (invalid) date header during restore. #432

Open
Leftium opened this issue Aug 14, 2023 · 1 comment
Open

Comments

@Leftium
Copy link

Leftium commented Aug 14, 2023

Full steps to reproduce the issue:

  1. Backup email with (invalid?) date header (Date: 2023-07-26 18:53:25.162982)
  2. Restore email using --cleanup.

Expected outcome: GYB gracefully handles invalid date header, either:

  • Skipping message
  • OR using cleanup date

Actual outcome: GYB exits with unhandled exception:

Traceback (most recent call last):
  File "gyb.py", line 2767, in <module>
  File "gyb.py", line 2239, in main
  File "gyb.py", line 1928, in message_hygiene
  File "email\utils.py", line 200, in parsedate_to_datetime
ValueError: Invalid date value or format "2023-07-26 18:53:25.162982"
[26812] Failed to execute script 'gyb' due to unhandled exception!

Work-around: modify date header in offending .eml file to Date: Wed, 26 Jul 2023 18:53:25 +0900

Notes: the offending email is successfully restored if --cleanup is not used.

@Leftium
Copy link
Author

Leftium commented Aug 14, 2023

I modified my gyb.py to gracefully skip messages that throw exceptions while cleaning.

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

1 participant