- /*
- ** This is hackish. If we are using a external rmmproc,
- ** then we need to update the current folder in the
- ** context so the external rmmproc will remove files
- ** from the correct directory. This should be moved to
- ** folder_delmsgs().
- */
- if (rmmproc) {
- context_replace (pfolder, folder);
- context_save ();
- fflush (stdout);
+ /* remove by refiling. */
+
+ folder_free(mp);
+ fflush(stdout);
+
+ if (msgs.size+6 > MAXARGS) {
+ adios(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];