procmail
[Top] [All Lists]

Re: Matching only after a certain point

2002-08-16 04:43:01
Cat asked,

| I was wondering if there was a way to instruct procmail to only apply a
| certain set of rules before or after a certain point in the message?

I'd imagine that there's no general answer; you'd have to consider each
specific case.

| For example, I'd like to only match for non-english characters before
| the signature delimeter so that I filter out non-english msgs (mostly ;)
| from my mailbox (they are mostly spam, I wont understand what they've
| written and my console doesn't display the chars anyway) but leave those
| that are in english but have their signature contain bits written in
| another language alone.

Unfortunately, there's no guarantee that a message will have a signature, nor
that the signature will be separated from the text with the traditionally
sanctioned hyphen-hyphen-space, nor that a line of hyphen-hyphen-space, if it
shows up, will be a signature delimiter.  But here are some ideas:

 :0B: # brackets enclose caret, tab, space, hyphen, tilde in that order
 * [^     -~].*$(.*$)*--( )
 foreign_character_spam
 # caret, space, hyphen, tilde, tab  would work too

[Hey, look, a spam recipe that won't match the post that it appears in.]

Or you could decide that, say, anything within six lines from the bottom is
part of a signature and anything with six more lines after the line where it
appears is not, but remember to allow two more lines for the closing blank
line and the terminating putative newline; on the other hand, if the
troublesome character is higher than the seventh-to-last line, the seventh and
eight lines after it might not be empty:

 :0B: # if there are eight more lines after the character, it's not in the
.sig
 * [^     -~].*$.*$.*$.*$.*$.*$.*$.*$.*$
 foreign_character_spam



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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