How to really easily save all tagged attachments in mutt

mutt

You can save all attachments via

  1. tag all attachments via hitting t
  2. ;
  3. s
  4. choose destination directory and hit a (all)

This works but has following severe side effect: you have to hit n-times enter for n attachments.

That means even if there are no file name collisions in the destination directory.

This is also documented in the Mutt FAQ.

Very inconvenient.

Some mutt users seem to recommend piping messages to munpack (example message linked). Good idea – but how to make Mutt prompt for a destination directory (as part of a munpack invoking macro)?

How do I construct such a macro? Or are there better solutions to this issue?

Best Answer

You could pipe the message to ripmime, which lets you specify a destination directory on the command line...e.g.:

ripmime -i - -d ~/myfiles/

The -i - tells ripmime to read from standard input, and -d specifies a destination directory. If that's too much typing, stick it in a shell script and call that (which will also make it easier if you want to use other of ripmime's many options for controlling its behavior).

If you add a macro like this to your configuration:

macro index,pager X "<pipe-message>ripmime -i - -d "

Then you can press "X", enter a destination directory, and press <RETURN> to run the command.

Related Question