- /* "remove" the SELECTED messages */
- folder_delmsgs (mp, unlink_msgs, 0);
+ /* remove by refiling. */
+
+ folder_free(mp);
+ fflush(stdout);
+
+ if (msgs.size+6 > MAXARGS) {
+ adios(EX_SOFTWARE, NULL, "more than %d messages for refile exec",
+ MAXARGS - 6);
+ }
+ vec = (char **)mh_xmalloc((size_t)(msgs.size + 6) * sizeof(*vec));
+ vec[vecp++] = "refile";
+ vec[vecp++] = "-src";
+ vec[vecp++] = concat("+", folder, NULL);
+ vec[vecp++] = "-nolink";
+ vec[vecp++] = concat("+", trashfolder, NULL);
+ for (msgnum = 0; msgnum < msgs.size; msgnum++) {
+ vec[vecp++] = msgs.msgs[msgnum];
+ }
+ vec[vecp] = NULL;