--- src/compose.c.orig 2011-07-21 23:17:20.000000000 +0200 +++ src/compose.c 2011-07-21 23:17:27.000000000 +0200 @@ -3442,6 +3442,8 @@ static gint compose_send(Compose *compose) { gchar tmp[MAXPATHLEN + 1]; + gchar plain[MAXPATHLEN + 1]; + gchar *outbox_file = tmp; gint ok = 0; if (compose->lock_count > 0) @@ -3479,10 +3481,25 @@ return -1; } } else { + /* original dump to be sent */ if (compose_write_to_file(compose, tmp, FALSE) < 0) { compose_unlock(compose); return -1; } + /* disable the encryption temporary to dump it in plain */ + if (compose->use_encryption) { + /* write the plain to a temporary file too */ + g_snprintf(plain, sizeof(plain), "%s%cplamsg.%p", + get_tmp_dir(), G_DIR_SEPARATOR, compose); + compose->use_encryption = FALSE; + + if (compose_write_to_file(compose, plain, FALSE) < 0) + g_warning(_("can't make a plain copy.")); + else + outbox_file = plain; + + compose->use_encryption = TRUE; + } } if (!compose->to_list && !compose->newsgroup_list) { @@ -3557,7 +3574,7 @@ fltinfo->flags.perm_flags = 0; fltinfo->flags.tmp_flags = MSG_RECEIVED; - filter_apply(prefs_common.fltlist, tmp, + filter_apply(prefs_common.fltlist, outbox_file, fltinfo); drop_done = fltinfo->drop_done; @@ -3568,7 +3585,7 @@ if (!drop_done) { outbox = account_get_special_folder (compose->account, F_OUTBOX); - if (procmsg_save_to_outbox(outbox, tmp) < 0) + if (procmsg_save_to_outbox(outbox, outbox_file) < 0) alertpanel_error (_("Can't save the message to outbox.")); else @@ -3583,6 +3600,7 @@ } g_unlink(tmp); + if (outbox_file != tmp) g_unlink(outbox_file); compose_unlock(compose); return ok;