procmail
[Top] [All Lists]

Re: Searching in body of message

1999-03-01 10:22:47
"Massimo D'Antoni" <dantoni(_at_)unisi(_dot_)it> writes:
I've started using procmail. What I want to do is to select all
those messages which contain a file attached which is in msword
format. 
I've tried to put the following rule in .procmailrc:

:O B
* ^Content-Type.*msword
attachments

Unfortunately procmail doesn't seem to find the regexp, and indeed
it cannot find ANY expression which is located in the header of the mime
encoded part of the message body.
How can I solve this problem?

You could change the capital oh into a zero.  When procmail sees the
'O' it doesn't recognize it as a valid recipe flag, so it ignores the
rest of the line, thereby losing the 'B' flag.  The recipe as written
therefore matches against the header instead of the body.

How do you avoid this sort of problem in the future?  Define a logfile
and examine it after sending a test message whenever you add or change
a recipe.  To set a logfile, assign the name of the file to the LOGFILE
variable at the top of your .procmailrc:

        LOGFILE = $HOME/procmail.log

If something isn't working correctly then you should turn on verbose
logging by putting the assignment
        VERBOSE = on

before the problem recipe(s).  In this case, the same key message is logged
whether or not VERBOSE is set:

        procmail: Skipped "O B"

When procmail says that it skipped something, the problem is usually
with the first character of the skipped string not being what procmail
was willing accept there.

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>