On 25Mar2021 23:23, Andy Spiegl <mutt.a...@spiegl.de> wrote: >> Use <pipe-message> to send the raw message to a script of your own. >> Some >> random macros of my own: >... >> macro index,pager V "<pipe-message>mail-open-attachments<enter>" >> "extract attachments to temp dir and open" > >Cool idea! >Would you mind sharing the "mail-open-attachments" with us?
The main trickiness of <pipe-message> is that you have the raw message - you need to extract the body part or whatever other bits you want. mail-open-attachments is here: https://hg.sr.ht/~cameron-simpson/css/browse/bin/mail-open-attachments?rev=tip It just makes a scratch directory and unpacks the message with the "munpack" command, which is part of the "mpack" package: https://web.archive.org/web/20190220145801/ftp.andrew.cmu.edu/pub/mpack/ The pops up the directory. I'm on a Mac so I do that with the "open" command, which pops up a Finder window for directory paths. The script uses datecode and fixexts from the same place: https://hg.sr.ht/~cameron-simpson/css/browse/bin/datecode?rev=tip https://hg.sr.ht/~cameron-simpson/css/browse/bin/fixexts?rev=tip datecode is just a convenience (which I use a lot) but fixexts is actually useful: it sniffs files and appends the corresponding extension (if the extension is missing), which helps file brwosers play nice, eg to open them with the correct application. If you want to grab everything related and the tissue box effect is too large, I can ship you a tarball or you can clone the repo. The repo is Mercurial (hg), I've got a public git clone too if you've not got Mercurial. Front page: https://hg.sr.ht/~cameron-simpson/css Cheers, Cameron Simpson <c...@cskk.id.au>