incubator-ponymail
incubator-ponymail copied to clipboard
Bug: generator should not rely on parsed data, in particular dates
The generator methods currently rely on the parsed message to create the hash. This is subject to change if the parsing should ever change. For example, headers might be unwrapped (or wrapped), and spacing may change if the parsing library is updated.
A particular problem is that the date is currently converted into UTC by the cluster generator. The library does not currently do much validation of the format (for example, the following date parses OK: 'Tue, 13 Jul 2004 17:09:03 -429496729500')
However if the validation is ever changed, then the date input to the hash will change. Given that the actual date is irrelevant to the hash, it should be treated the same as any other header, i.e. as textual input only.
If the parsed message is to be used for the hash, then headers need to be normalised before use.
Another difference is how >From_ lines are treated when importing. This will depend on the parser and its settings. The body may also be subject to encoding issues. This means that the body is somewhat unreliable as a stable source for the hash.