LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 07:20 PM   #1
lmcilwain
Member
 
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390

Rep: Reputation: 31
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, 07:40 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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, 08:17 PM   #3
lmcilwain
Member
 
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390

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

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


Reply



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 04:19 PM
Procmail not filtering WiWa Linux - Networking 0 07-06-2004 02:22 PM
Procmail not filtering tomac Linux - General 0 05-26-2004 03:15 PM
How do I make procmail recognize ISO encoded subject headers (=?ISO-)? xeza Linux - Software 0 10-06-2003 01:16 PM
suggestions for subject line when posting. abrakadabra LQ Suggestions & Feedback 14 05-16-2002 09:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:47 PM.

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
Open Source Consulting | Domain Registration