LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Procmail Filtering Using a Full Subject Line (https://www.linuxquestions.org/questions/linux-software-2/procmail-filtering-using-a-full-subject-line-412785/)

lmcilwain 02-07-2006 07:20 PM

Procmail Filtering Using a Full Subject Line
 
Can anyone tell me how I can get procmail to filter on a full subject line instead of just one word of the subject line?

Every FAQ and man page I went to only shows an example of filtering a subject line with one word. I need to be able to do more then one.

Here is a current example of what I have in my .procmailrc file:


:0:
* ^Subject:.*Automated Bug Report*
"$HOME/Database Messages"

I have tried the following:

:0:
* ^Subject:.*Automated *Bug *Report*
"$HOME/Database Messages"

:0:
* ^Subject:.*Automated/Bug/Report*
"$HOME/Database Messages"

:0:
* ^Subject:.*Automated+Bug+Report*
"$HOME/Database Messages"

Any help is appreciated.

gilead 02-07-2006 07:40 PM

I haven't had time to check this, but from man procmailex:
Code:

Forward all mail from peter about compilers to william (and keep a copy of it here  in  pet-compil).

  :0
  * ^From.*peter
  * ^Subject:.*compilers
  {
    :0 c
    ! william@somewhere.edu

    :0
    petcompil
  }

The main difference to yours is the '*'. In the procmail examples it is used in a regex, ie with the preceding character which is a '.' and means 0 or more of any character (except a new-line). You have used the * the same way as a file system glob, ie as a multi character wildcard. Try using the following as your search string:
* ^Subject:.*Automated.*Bug.*Report.*

lmcilwain 02-07-2006 08:17 PM

That looks to have done it, I would have never figured that out. Thanks for the insight.

gilead 02-08-2006 01:07 PM

No problem - glad it worked :)


All times are GMT -5. The time now is 06:14 PM.