-.TH MH-PROFILE %manext5% "November 6, 2012" "%nmhversion%"
+.TH MH-PROFILE %manext5% "March 18, 2013" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
none
.RS 5
This is the program used by
-.B rmm
+.BR rmm ,
+.BR refile ,
and
-.B refile
+.B mhfixmsg
to delete a message from a folder.
.RE
.PP
-.TH MHFIXMSG %manext1% "March 17, 2013" "%nmhversion%"
+.TH MHFIXMSG %manext1% "March 18, 2013" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
.IR file ]
.RB [ \-outfile
.IR outfile ]
+.RB [ \-rmmproc
+.IR program ]
+.RB [ \-normmproc ]
.RB [ \-verbose " | " \-noverbose ]
.RB [ \-version ]
.RB [ \-help ]
profile component, if present. If not present,
.B mhfixmsg
moves the original message to a backup file.
+The
+.B \-rmmproc
+switch may be used to override this profile component. The
+.B \-normmproc
+switch disables the use of any
+.I rmmproc
+profile component and negates all prior
+.B \-rmmproc
+switches.
.PP
.SS "Integration with procmail"
By way of example, here is an excerpt from a procmailrc file
-.TH REFILE %manext1% "January 18, 2001" "%nmhversion%"
+.TH REFILE %manext1% "March 18, 2013" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
.SH BUGS
Since
.B refile
-uses your
+and
+.B rmm
+use your
.I rmmproc
to delete the message,
the
.B NOT
call
.B refile
+or
+.B rmm
without specifying
.BR \-normmproc ,
or you will create an infinite loop.
-.TH RMM %manext1% "February 13, 2013" "%nmhversion%"
+.TH RMM %manext1% "March 18, 2013" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
.RI [ +folder ]
.RI [ msgs ]
.RB [ \-unlink " | " \-nounlink ]
+.RB [ \-rmmproc
+.IR program ]
+.RB [ \-normmproc ]
.RB [ \-version ]
.RB [ \-help ]
.ad
rmmproc: /home/foouser/bin/rmm_msgs
.RE
.PP
-then instead of simply renaming the message file,
+Then instead of simply renaming the message file,
.B rmm
will call
the named program or script to handle the files that represent the
messages to be deleted.
+The
+.B \-rmmproc
+switch may be used to override this profile component. The
+.B \-normmproc
+switch disables the use of any
+.I rmmproc
+profile component and negates all prior
+.B \-rmmproc
+switches.
.PP
An example of a
.I rmmproc
If a folder is given, it will become the current folder.
.SH BUGS
Since
+.B rmm
+and
.B refile
-uses your
+use your
.I rmmproc
to delete the message,
the
must
.B NOT
call
+.B rmm
+or
.B refile
without specifying
.BR \-normmproc ,
-or you will create an infinte loop.
+or you will create an infinite loop.
-[no]fixcte
-file file
-outfile file
+ -rmmproc program
+ -normmproc
-[no]verbose
-version
-help
"${MH_TEST_DIR}/Mail/inbox/14.original"
+# check -normmproc
+cp "${MH_TEST_DIR}/Mail/inbox/18" "${MH_TEST_DIR}/Mail/inbox/19"
+
+run_test 'mhfixmsg 18 -normmproc'
+check "${MH_TEST_DIR}/Mail/inbox/19" \
+ "${MH_TEST_DIR}/Mail/inbox/,18" 'keep first'
+
+
+# check -rmmproc
+run_test 'mhfixmsg 19 -rmmproc true'
+if test -f '${MH_TEST_DIR}/Mail/inbox/19.backup'; then
+ echo check of mhfixmsg -rmmproc FAILED, should not have created backup file
+ failed=`expr ${failed:-0} + 1`
+fi
+
+
# make sure there are no tmp files left over
find "$MH_TEST_DIR/Mail" \( -name 'mhfix*' -o -name ',mhfix*' \) -print \
>"$actual"
X("nofixcte", 0, NFIXCTESW) \
X("file file", 0, FILESW) \
X("outfile file", 0, OUTFILESW) \
+ X("rmmproc program", 0, RPROCSW) \
+ X("normmproc", 0, NRPRCSW) \
X("verbose", 0, VERBSW) \
X("noverbose", 0, NVERBSW) \
X("version", 0, VERSIONSW) \
outfile = *cp == '-' ? add (cp, NULL) : path (cp, TFILE);
continue;
+ case RPROCSW:
+ if (!(rmmproc = *argp++) || *rmmproc == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ continue;
+ case NRPRCSW:
+ rmmproc = NULL;
+ continue;
+
case VERBSW:
verbosw = 1;
continue;
#define RMM_SWITCHES \
X("unlink", 0, UNLINKSW) \
X("nounlink", 0, NUNLINKSW) \
+ X("rmmproc program", 0, RPROCSW) \
+ X("normmproc", 0, NRPRCSW) \
X("version", 0, VERSIONSW) \
X("help", 0, HELPSW) \
while ((cp = *argp++)) {
if (*cp == '-') {
switch (smatch (++cp, switches)) {
- case AMBIGSW:
+ case AMBIGSW:
ambigsw (cp, switches);
done (1);
- case UNKWNSW:
+ case UNKWNSW:
adios (NULL, "-%s unknown\n", cp);
- case HELPSW:
+ case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
invo_name);
print_help (buf, switches, 1);
case NUNLINKSW:
unlink_msgs = 0;
continue;
+
+ case RPROCSW:
+ if (!(rmmproc = *argp++) || *rmmproc == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ continue;
+ case NRPRCSW:
+ rmmproc = NULL;
+ continue;
}
}
if (*cp == '+' || *cp == '@') {