MIME decode: Content-Type ext for other unnamed parts

Here you can propose new features, make suggestions etc.

Moderators: white, sheep, Hacker, Stefan2

Post Reply
User avatar
Usher
Member
Member
Posts: 129
Joined: 2011-03-11, 10:11 UTC

MIME decode: Content-Type ext for other unnamed parts

Post by *Usher » 2018-06-12, 16:30 UTC

ghisler(Author) wrote:30.05.18 Release Total Commander 9.20 beta 5 (32/64)
(...)
29.05.18 Added: Decoding of MIME files where the name wasn't given -> use .txt extension for TEXT/PLAIN fields, and .htm for TEXT/HTML instead of .bin (32/64)
I think it's also possible to use Content-Type declared for other MIME types, when dealing with unnamed files, f.e.
* Content-Type: image/jpeg – add jpeg extension
* Content-Type: text/css – add css extension
* Content-Type: application/epub+zip – add epub extension
etc.

Current list of media types is available at IANA site here: https://www.iana.org/assignments/media-types/media-types.xhtml

The list is very long and contains many exotic types so I don't think it should be fully supported. Some most common types (f.e. image/jpeg, image/png, image/gif) can be hardcoded like text/plain and text/html now, but the best solution is to keep media type list available for user editing.
It may be a separate list or a part of wincmd.ini, something like:

Code: Select all

[MediaTypes]
txt=text/plain
html=txt/html
jpeg=image/jpeg
png=image/png
epub=application/epub+zip
dat=unsupported
The last entry is extension for unsupported media types. I think it should be also user defined. TC uses bin here, but some popular email clients (f.e. MS Outlook, Outlook Express, Windows Mail/Live Mail) use (or used in the past) dat extension.
Regards from Poland
Andrzej P. Wozniak

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36511
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-06-13, 17:26 UTC

I'm aware of that. But normally in e-mails just the text doesn't have a name, the attachments usually have one.
Author of Total Commander
http://www.ghisler.com

User avatar
Usher
Member
Member
Posts: 129
Joined: 2011-03-11, 10:11 UTC

Post by *Usher » 2018-06-15, 20:01 UTC

I think that people mostly don't use TC for decoding or viewing normal, standard-compliant emails. I'd rather expect using these features for spam or other suspicious messages. Such messages are usually generated automatically and don't conform internet standards, so they may contain unnamed parts.
There may be also "normal emails" – containing invoices, notifications, confirmations etc. generated automatically by lame corporation software. In such cases it may be difficult to recognize which email comes from real corpo and which one is spoofed and malicious.
Regards from Poland
Andrzej P. Wozniak

Post Reply