Re: Detecting attachment types by file extension.. how to change exmh's behaviour?
Brian Foster <[email protected]>
| Newsgroups | gmane.mail.exmh.user |
|---|---|
| Message-ID | <[email protected]> |
| Date: Thu, 24 May 2007 08:55:39 -0500 | From: Stephen Wilcoxon <[email protected]> | | I don't have much experience with MacOS-X but it looks to me like the | problem is with /usr/bin/open and not with exmh. I've never heard of a | unix command that operates based on file extensions before (rather than | determining type based on file contents (eg file)). | | If open is a shell script, I'd suggest rewriting it. If it is a binary, | I'd suggest bypassing it and calling the appropriate application | directly in the mailcap (eg "audio/*; /usr/bin/musicprog %s"). | | -----Original Message----- | From: [email protected] (On Behalf Of Marc Baaden) | Sent: Thursday, May 24, 2007 8:49 AM | Subject: Detecting attachment types by file extension.. how to change exmh's behaviour? |[ ... ] the problem is that exmh saves its attachment with the extension | .exmh which is a problem for [ /usr/bin/open ]. As an example, I have a | audio WAV file attachment which does not open [ as something.exmh ] | but which opens properly if I rename it to something.wav. Furthermore I | see that the filename is declared as whatever.wav in the actual mail | message. | | So I wonder whether I couldnt' get exmh to just use that filename as | temporary file, as then the open command would work fine on it. I don't know if it is possible to get EXMH to use the filename in the e-mail attachment or not, but I would Strongly Advise against it: 1st, either by accident or deliberately, the name in the attachment may name a file you care about (e.g., /etc/password or .profile or whatever); and 2nd, not all attachments specify a filename (it's optional). Stephen is right; you should be using the type of the file's contents, as determined by the file(1) command (nominally), to decide what to do next. If you are using GNU `file', the `-i' (alias `--mime') option is very very useful here. cheers! -blf- -- ▶ ▶ I AM CURRENTLY LOOKING FOR A JOB! ◀ ◀ | Brian Foster Experienced (>25 yrs) software engineer: | Montpellier, FRANCE • Unix, Linux, embedded, design-for-test; | Stop E$$o (ExxonMobile)! • Software/hardware co-design, debugging; | http:/www.stopesso.com • Kernels, drivers, filesystems, &tc; Résumé (CV) & contact details: • IDL, automated testing, process, &tc. http://www.blf.utvinternet.ie