Download all images from email and store them in a folder

28 views
Skip to first unread message

Shivam Kalra

unread,
May 3, 2016, 11:44:01 PM5/3/16
to mu-discuss

Hi all,

My friends and family share their pictures with me on email. On average
each email contains about 7-8 images and I end up in saving each one of
them individually to my local directory, which is very cumbersome. I've used
`mu4e-view-save-attachment-multi` which takes off some pain, but it does
not rename the file, if it already exist in my local saving folder.

Therefore, I'm looking for a simple script or function (either emacs or
command line based cron job) that will save all images (mime:images/*)
attached to emails from certain people into a folder, handling all
renaming by itself.

I've tried using nice script provided by Stephen
Eglenhttps://groups.google.com/forum/#!topic/mu-discuss/lowtFr4HOGE, but
no luck.I've also tried writing a bash script, but I'm not sure, how
could I achieve it?

# This is not giving me email path
mu find from:----- 'mime:images/*'

# I some need to extract all those emails then
# extract their images attachment and synch in my folder
mu extract attachments $EMAILS

Any help would be appreciated.

--
Best,
Shivam Kalra

Dirk-Jan C. Binnema

unread,
May 4, 2016, 1:25:34 PM5/4/16
to mu-di...@googlegroups.com
Hi Shivam,
Something like:

mu find 'mime:image/jpeg' --exec 'mu extract --save-attachments'

is roughly what you ask for; it extracts all attachments in messages
with at least one jpeg image.

This does not handle images with same name though; if you have a lot of
those, you could try the to make the --exec part a bit smarter by
renaming files to some pattern.

I guess it would be useful if mu could do the auto-renaming for
you... feel free to file a github issue for that.

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
Reply all
Reply to author
Forward
0 new messages