run-mailcap(1), which sup uses to view attachments, doesn't exist on OS X.

I used the mime-decode hook to monkey patch Attachment.view! to also use the 
mime-decode hook. A case statement works as a pretty good replacement for my 
simple .mailcap.

view_attachment[1] uses file(1) to figure out what an attachment's extension 
should be, before passing it to open(1). For quicklook I went another way, 
converting from the MIME type to the OS X UTI[2] using mime2uti, an ugly little 
program I made.

It's messy, but seems to work for my attachements.

[1] http://filibusta.crema.unimi.it/~gufo/files/view_attachment.sh
[2] http://en.wikipedia.org/wiki/Uniform_Type_Identifier

Attachment: mime-decode.rb
Description: Binary data

Attachment: mime2uti.m
Description: Binary data

_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to