apache / incubator-ponymail

Apache Pony Mail (Incubating) - Email for Ponies & People
http://ponymail.incubator.apache.org/
Other
80 stars 30 forks source link

convertToWrapped expects a bytestring #518

Closed Humbedooh closed 4 years ago

Humbedooh commented 4 years ago

Additionally, be more specific in our format=flowed search

sebbASF commented 4 years ago

-1, as this changes the source used for hash generation. This will break most of the existing generators.

If it is desired to apply the reformatting, it needs to be done after the MID calculation.

However note that in my experiments, the reformatting causes badly wrapped output.

Humbedooh commented 4 years ago

Would it be better to look into rolling our own converter? The codebase looks very simple.

Humbedooh commented 4 years ago

or perhaps the formatflowed.decode() option is better suited instead of convertToWrapped...

sebbASF commented 4 years ago

I think we need to gather some test cases.

There are quite a few instances of format=flowed in the unit test corpus file users_httpd_apache_org_2020-07.mbox, however they don't seem to be the sort of messages that need to be wrapped.

Note: I got better results by specifying ' wrap_fixed=False' on the above corpus.

sebbASF commented 4 years ago

I found a few cases where the first convertToWrapped call actually worked. So I think the solution is to leave the current code exactly as is so id generation is not affected.

Once the id has been calculated, the body can be reformatted as necessary for storage in the database.