- done=armed_done;
- switch (setjmp(env)) {
- case OK:
- status = sendaux(vec, vecp, drft, st) ? NOTOK : OK;
- if (status == OK) {
- /* move original draft to +trash folder */
- snprintf(buffer, sizeof buffer,
- "</dev/null refile -file %s +trash",
- original_draft);
- if (system(buffer) != 0) {
- advise(NULL, "unable to trash the draft");
- }
+ if ((status = sendaux(vec, vecp, drft, st)) == OK) {
+ /* move original draft to +trash folder */
+ /* temporary close stdin, for refile not to ask */
+ dupfd = dup(0);
+ close(0);
+ if (execprogl("refile", "refile", "-file",
+ original_draft, "+trash",
+ (char *)NULL) != 0) {
+ advise(NULL, "unable to trash the draft");