uchicago-library / attachment-converter

Attachment Converter: tool for batch converting attachments in an email mailbox
GNU General Public License v2.0
8 stars 3 forks source link

15 display all attachment types #28

Closed nmmull closed 2 years ago

nmmull commented 2 years ago

Fairly straightforward. Just a few notes:

waclena commented 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.

nmmull commented 2 years ago

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.

bufordrat commented 2 years ago

Sticking a downcase in there so that Text/Plain and text/plain don't come out as two MIME types...