LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 02-07-2006, 08:20 PM   #1
lmcilwain
Member
 
Registered: Dec 2003
Location: Maryland
Distribution: Fedora 14
Posts: 367

Rep: Reputation: 30
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.
 
Old 02-07-2006, 08:40 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
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.*
 
Old 02-07-2006, 09:17 PM   #3
lmcilwain
Member
 
Registered: Dec 2003
Location: Maryland
Distribution: Fedora 14
Posts: 367

Original Poster
Rep: Reputation: 30
That looks to have done it, I would have never figured that out. Thanks for the insight.
 
Old 02-08-2006, 02:07 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
No problem - glad it worked
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spamassasin, Tagging Subject line lapthorn Linux - Networking 1 09-30-2004 05:19 PM
Procmail not filtering WiWa Linux - Networking 0 07-06-2004 03:22 PM
Procmail not filtering tomac Linux - General 0 05-26-2004 04:15 PM
How do I make procmail recognize ISO encoded subject headers (=?ISO-)? xeza Linux - Software 0 10-06-2003 02:16 PM
suggestions for subject line when posting. abrakadabra LQ Suggestions & Feedback 14 05-16-2002 10:03 PM


All times are GMT -5. The time now is 11:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration