Go to the previous section
Using the readmsg command, it is quite easy to test the rules
you've written to see if they do what you desire.
For example, we can use the -n option to filter, which means
"don't actually do this, just tell me what rule you matched, if
any, and what action you would have performed" (you can see why a
single letter option is easier to type in!!), and feed it each
message in our mailbox by using a command like:
% set message=1
% set total_messages=`messages`
% while (1)
> if ($message > $total_messages) exit
> readmsg -h $message | filter -n
> @ message++
> end
which will then hand each of the messages in your mailbox to the
filter program and display what action would have been taken with
that message and why.
For example, if we do this for a few interesting messages in my
mailbox, we'd end up with output like:
Mail from taylor about filter test
FORWARDED to hpldat!taylor by rule;
subject="filter test" ? forward "hpldat!test"
Mail from bradley%hplkab@hplabsc about Re: AI-ED mailing address for HP
PUT in mailbox: the default action
Mail from taylor about display-to-console
EXECUTED "cat - > /dev/console"
(Sharp users will notice that this is exactly the same format as
the longer summary listing.)
Go to the next section