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

mailbox Babyl support should use visible header as full header when full header is empty #114579

Open
jikamens opened this issue Jan 26, 2024 · 4 comments
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@jikamens
Copy link

jikamens commented Jan 26, 2024

Bug report

Bug description:

The Babyl message file format supported by the mailbox module has two sections for headers; a "full" header section and a "visible" headers section. Software that uses the Babyl software natively interprets an empty "full" header section as meaning that the visible and full headers are identical, so they don't have to be stored twice in the file. The Python module doesn't do this; if it encounters a message in a Babyl file which has nothing between the labels line and the '*** EOOH *** line, it creates a message object with no headers. Instead, in this case it should interpret the headers after the *** EOOH *** line as full headers for the message.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

@jikamens jikamens added the type-bug An unexpected behavior, bug, or error label Jan 26, 2024
@serhiy-storchaka
Copy link
Member

Thank you for your report. What software interprets an empty "full" header section as meaning that the visible and full headers are identical? Are you interesting in creating a PR?

@jikamens
Copy link
Author

Thank you for your report. What software interprets an empty "full" header section as meaning that the visible and full headers are identical?

I mean, is there any software besides Emacs that uses Babyl format anymore? ;-)

I'm pretty sure Emacs behaves as I described.

Are you interesting in creating a PR?

As I noted in the other ticket, I'll try, but I am very busy and can't make any promises about when I'll get to it.

@serhiy-storchaka
Copy link
Member

Since Python module is lower level than the Emacs application, I wonder whether it is okay to keep "full" headers empty and let the application to decide if it want to use "visible" headers in this case.

@jikamens
Copy link
Author

The question I'm concerned about is what happens when you read a message from a BABYL file and immediately insert it into an MBOX file. I believe that should work properly out of the box, and it doesn't right now if the BABYL message has no full header; the message in the MBOX file just ends up with an empty header, which is obviously wrong.
If there were an init kwarg or some other way to indicate when creating the BABYL mailbox object that all messages created by that object should use the visible header as the full header when the latter is empty, then I suppose that would be sufficient, but I personally think it would be preferable for that to be the default behavior. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-email type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
@jikamens @serhiy-storchaka and others