Closed nmmull closed 2 years ago
Matt Teichman @.***> writes:
Not sure off the top of my head what causes the extra indented text/plain at the beginning, but if an easy fix suggests itself, might be worth doing. Does whitespace need to get trimmed off the MIME type strings? Not sure.
Mime headers in parts are exactly like normal mail headers at the top of a message. In the latter case, there can be any amount of whitespace separating the header name from the value, so the same is true for headers in mime parts. So the value part of these two headers:
Content-Type: text/plain
Content-Type: text/plain
should be the same: "text/plain".
I'd expect the ocamlnet header parser to return it correctly, but if it doesn't I think we should String.(trim whitespace) the value.
Yeah, admittedly what I'm doing is super basic, I wanted to see if we could get away without using the ocamlnet parser.
But I think the issue was just a dumb one, I was trimming spaces instead of all whitespace. Fixed this, I probably won't be able to test it until Wednesday but since it was such a simple fix, I pushed it and you can review/test it before then if you have time.
Sticking a downcase in there so that Text/Plain
and text/plain
don't come out as two MIME types...
Fairly straightforward. Just a few notes:
mbox
s we have access to, seems to work alright, a bit slow, but I don't think it could be terribly faster unless it was parallelized.