procmail
[Top] [All Lists]

RE: If no subject, then take first line of body...

2001-03-27 01:40:13

I don't know why you're so fond of excess nesting, Timothy.

Often times I'm doing multiples processes, so I've gotten in the habit of
thinking that way, but in this case it does look unnecessary.



Since I'm guessing that you want to allow medial parentheses, here:

 :0fwh
 * ! ^Subject:
 * B ?? ^\(\/.*[^)]
 | formail -I"Subject: $MATCH"

I'm not too comfortable with the plan of accepting the text after any flush-
left left parenthesis in the body and if it were my setup I'd allow it only
on the top line; that way it could pick up only items intended as subjects
and not stray text strings.  Accordingly, I'd start the regexp with ^^ in-
stead of just ^.

In my very specific context (the above recipe is part of my cellphone.rc which
only gets executed when I send a msg from my cell phone to my procmail account)
I can rest pretty comfortably knowing that there will not be more than one line
(and therefore no real concern about other ( ) marks anywhere)

However, since I will most likely use this again (adapted) in other situations,
I'll probably use your suggestion of (if I have it right)

:0fhw
* ! ^Subject:
* B ?? ^^\(\/.*[^)]
| formail -I"Subject: $MATCH"


Thanks for the help again... I am filing away all these little details and
improving things.  Mostly I can usually find "a way" to make things work, but
I'm not finding the best way.

TjL

_______________________________________________
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>