On Wed, Sep 14, 2016 at 04:12:48PM -0700, Are Troi wrote:
> Hi All,
> Last night at a technical talk I lamented the loss around 5 years ago
> from Fedora of command-line tools to extract email attachments from a
> BASH script and a colleague told me Mutt can do this.
> ...

Maybe you could use the program 'ripmime' directly from bash. I found
it in the debian repositories. I use it manually through a mutt macro

    macro index Ys "| ~/.mutt/saveattachments\n" "Save attachments"

in my muttrc file. The script 'saveattachments' is the following

    # put filenames into arguments
    # empty directory unless it is already empty
    set - ~/attachments/*   
    [ "$*" != "$HOME/attachments/*" ] && rm ~/attachments/*
    ripmime -i - -d ~/attachments

I always use the same directory to save the attachments manually, but
I guess the lines above may be modified to let mutt save the
attachments automatically in the desired directory.


W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
Apdo. Postal 48-3, 62251             |                           (*)/\/  \
Cuernavaca, Morelos, México          | moc...@fis.unam.mx   /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB

Reply via email to