diff --git a/lib/mu-msg-sexp.c b/lib/mu-msg-sexp.c index 6e8ce220..94b9c2f1 100644 --- a/lib/mu-msg-sexp.c +++ b/lib/mu-msg-sexp.c @@ -226,6 +226,8 @@ get_temp_file_maybe (MuMsg *msg, MuMsgPart *part, MuMsgOptions opts) { char *tmp, *tmpfile; + opts |= MU_MSG_OPTION_USE_EXISTING; + if (!(opts & MU_MSG_OPTION_EXTRACT_IMAGES) || g_ascii_strcasecmp (part->type, "image") != 0) return NULL; diff --git a/mu/mu-cmd-server.c b/mu/mu-cmd-server.c index 5a626cf5..7f97efca 100644 --- a/mu/mu-cmd-server.c +++ b/mu/mu-cmd-server.c @@ -416,13 +416,14 @@ each_part (MuMsg *msg, MuMsgPart *part, GSList **attlist) char *att, *cachefile; GError *err; - /* exclude things that don't look like proper attachments */ - if (!mu_msg_part_maybe_attachment(part)) + /* exclude things that don't look like proper attachments, + * unless they're images */ + if (!mu_msg_part_maybe_attachment(part) || + g_strcmp0 (part->type, "image") != 0) return; err = NULL; - cachefile = mu_msg_part_save_temp (msg, - MU_MSG_OPTION_NONE, + cachefile = mu_msg_part_save_temp (msg, MU_MSG_OPTION_NONE, part->index, &err); if (!cachefile) { print_and_clear_g_error (&err);