procmail
[Top] [All Lists]

Re: How do I filter the body?

2000-11-26 13:34:45
Robert asked,

| I am trying to send all email with the word password in it to a folder
| called password.  what I have so far is:
| 
| :0 c:
| * 0^0

That line does nothing but waste cycles.

| * 1^0 Subject.*password

OK.

| * 1^0 B.*password

That looks for "B[any string]password" anywhere in the head and scores 1 if
it's found.

| passwords

| Is this correct.  Well, I know it isn't because it isn't working.

I think what you wanted was this,

 :0c:
 * 1^0 ^Subject:.*password
 * 1^0 B ?? password
 passwords

which is better done this way (so that a match in the subject will skip the
step of searching the body):

 :0c:
 * 9876543210^0 ^Subject:.*password
 * 1^0 B ?? password
 passwords

but simply looking for it in the entire text makes more sense:

 :0HBc:
 * password
 passwords

If you're concerned about false matches if the password appears in header
lines other than the subject, you can do this:

 :0HBc:
 * ^^(.+$)*(Subject:|$(.*$)*).*password
 passwords

and that will match only on occurrences in the subject or the body.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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