procmail
[Top] [All Lists]

Re: Trapping multiple subject lines into a single file

2010-01-12 11:45:48
inline

On Tue, 2010-01-12 at 08:54 -0800, Professional Software Engineering
wrote:
At 09:59 2010-01-12 -0600, Christopher L. Barnard did say:
I want any email with six specific subject lines to go into a seperate
folder.  I have in my procmail rules

:0:
* ^Subject:.( *Distribution List for Vault |
              *Report to Accompany off-site Media |
              *Picking List for Robot |
              *Picking List for Vault |
              *Detailed Distribution List |
              *Off-site Inventory )
/opt/home/cbarnard/mail/backupstatus

What does your VERBOSE logfile have to say about this?

[...]
procmail: Invalid regexp "^Subject:.( *Distribution List for Vault |"
procmail: Invalid regexp "Off-site Inventory )"
[...]

which I already knew.  Hence this email <grin>

Why do you have * at the start of each?

There are multiple tape libraries that identify themselves at the
beginning of the subject line.  So "L700: Distribution list" and "L180:
Distribution List" and "Testlab: Distribution List" all go into the same
file.

Why don't you have a CONTINUATION at the end of each of these broken lines?

Bingo.  I forgot the \.

Are these subject lines NEVER a reply form (Re: Fwd: and the like)?  You 
probably really want to have a wildcard BEFORE the grouped list of text.

Nope.  If anyone replies or forwards these messages I want them to not
be filtered but to into my main inbox.  Besides, I have another rule
farther down that duplicates all Re: messages (like this one) into a
seperate responses folder.

Each of the texts is delimited on both sides with spaces - though because 
the * at the front, the leading space is considered optional (ZERO or 
more), and the leading whitespace on the individual continuation lines is 
stripped anyway.

:0:
* ^Subject:.*(Distribution List for Vault|Report to Accompany off-site Media|\
         Picking List for Robot|Picking List for Vault|\
         Detailed Distribution List|Off-site Inventory)
/opt/home/cbarnard/mail/backupstatus

Note .* wildcarding BEFORE the string list, each stringlist item doesn't 
have a * in front of it, has no delimiting spaces, and the lines (except 
the last) have a continuation escape on them.

I'll change my rule to match this.  Your sandbox results look better
than mine do...

Tossed into a sandbox, your original nets:

procmail: Invalid regexp "^Subject:.( *Distribution List for Vault |"
procmail: Match on "^Subject:.( *Distribution List for Vault |"
procmail: Match on "Report to Accompany off-site Media |"
procmail: Match on "Picking List for Robot |"
procmail: Match on "Picking List for Vault |"
procmail: Match on "Detailed Distribution List |"
procmail: Invalid regexp "Off-site Inventory )"
procmail: No match on "Off-site Inventory )"


The rewritten one (granted, against an arbitrary message without the text, 
but the point here is no ERRORS):

procmail: No match on "^Subject:.*(Distribution List for Vault|Report to 
Accompany off-site Media|Picking List for Robot|Picking List for 
Vault|Detailed Distribution List|Off-site Inventory)"

Note how that despute the conditions being on separate lines, because they 
properly have continuation markers, the regexp is pulled into one 
string?  Thus the first and last portions (which have parens, which are 
expected to be parsed in matching pairs), don't belt out as invalid regexps.

not found any examples where multiple messages are sent to the same
folder (without there being a separate rule for every subject line).

Huh?  There's gobs of instances where people do this.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

-- 
------------------------------------------------------------------
Christopher L. Barnard                                312-942-9649
Senior IS Engineer                 
Rush University Medical Center                   cbarnard(_at_)rush(_dot_)edu




____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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