Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 8 down vote accepted

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.

share|improve this answer
ok, this is similar to the munpack approach - but how to nicely integrate it into mutt (via a macro that asks for a destination directory - such that you don't have to use a global directory) – maxschlepzig Apr 26 '12 at 9:29
I've updated my answer with an example. – larsks Apr 26 '12 at 12:57
ok, it is easier than I thought - because mutt macros are just a sequence of keypresses. Thus, if you just leave out a <return> in your macro then you can interactively finish the prompt. – maxschlepzig Apr 27 '12 at 8:14
Fantastic! Too bad I can upvote only once. What's really great about this solution is it works for multiple messages as well. Just tag 'em and ;|. – Aryeh Leib Taurog Dec 14 '14 at 15:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.