Hello Bob, (it's really hard with a "Bob", always makes me think of "No Other Baby" from Bob Watson; not to talk about Bobby Charlton... sorry)
Bob Tennent <[email protected]> wrote: |> Bob Tennent <[email protected]> wrote: |>|For this kind of attachment, I seem to have a choice between |>|sending all such attachments to a fixed application or |>|using the write command to save to a file or pipe to an |>|application. I'd like to select the application based on the |>|(extension of) the file name. Is there any convenient way to |>|do this? At present, I have to |>| |>| + capture the file name in the clipboard |>| + delete the file name |>| + type "| cat filename; application filename" |> |> well, if there is a file extension you want to trust then setting |> the variable *mime-counter-evidence* should do what you want. | |Thanks. | |So I've set mime-counter-evidence and now I'm getting, for e.g., | |Content-Type: application/octet-stream; name="COMP-2014-07-01.csv" |Content-Disposition: attachment; filename="COMP-2014-07-01.csv" | |and the text. But I want .csv files to be opened by a spreadsheet |application such as gnumeric. Well ok, what can be done about this right now is that there is a new *pipe-EXTENSION* hook which takes precedence, so that *mime-counter-evidence* and *pipe-csv* should get you going with this, should you really want it. I refrain from digging deeper into this before S-nail has been rewritten with the v15 infrastructure. Because, just as Gavin Troy has pointed out absolutely correct, the current way of doing things in S-nail is very problematic in respect to security issues, since when you really set *pipe-csv* then S-nail will of course always open any .csv in your spreadsheet whenever you open the parent message. However, to overcome this we first need to have a different internal send layer with a one-pass parser that parses the structure before we go and actually display a message. I.e., whereas it is likely that we will never be as comfortable as mutt(1) or any other MUA with builtin $PAGER, we will have a message-structure overview and one will be able to explicitly select desired parts, even in multi-messages a-time view, therefore giving users the interactive choice wether opening a part is really desired -- or not. But anyway, *pipe-EXTENSION* is something that will remain, and in the far future of a v15 infrastructure things like (hypothetic) define pipemac { clone name=$1 base=$2 ext=$3 if $name =~ 'README|INSTALL|TODO|COPYING|*.(txt|rc|cfg|conf)$' return 'text/plain' elif $ext =~ 'gz$' return 'application/gzip' else shellset i /usr/bin/file --preserve-date $name return $i endif } will hopefully be possible, therefore giving users a choice to freely and dynamically work with MIME parts. Hope this helps (the code is on the [next] branch of the S-nail git repository), Ciao, --steffen ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ S-nail-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/s-nail-users
