procmail
[Top] [All Lists]

Re: Trapping multiple subject lines into a single file

2010-01-12 10:54:56
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?

Why do you have * at the start of each?

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

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.

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.


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

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