14 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] maildrop filter: body...
FromSent OnAttachments
Chris MastersOct 14, 2003 8:02 am 
Chris MastersOct 14, 2003 9:06 am 
John LockeOct 14, 2003 9:35 am 
Martin List-PetersenOct 15, 2003 2:37 am 
Chris MastersOct 15, 2003 3:52 am 
John LockeOct 15, 2003 10:34 am 
Rob HuttonOct 15, 2003 11:02 am 
Chris MastersOct 16, 2003 5:03 am 
Arnaud PignardJan 28, 2004 9:07 pm 
Chris MastersJan 30, 2004 10:48 am 
Arnaud PignardJan 30, 2004 3:26 pm 
Robbie ScottJan 31, 2004 9:58 pm 
Devin RubiaFeb 2, 2004 7:06 am 
Chris MastersFeb 3, 2004 1:31 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] maildrop filter: body begins with patternActions...
From:Devin Rubia (dev@thezone.net)
Date:Feb 2, 2004 7:06:41 am
List:net.sourceforge.lists.courier-maildrop

On Sat, Jan 31, 2004 at 09:51:42PM -0800, Robbie Scott wrote:

Is there a way to test the body to see if it begins with a certain pattern? I know that the "^" anchor matches patterns at the beginning of a line, but unfortunately it matches the the pattern at the beginning of any line. That is /^foo/:b finds foo at the beginning of any line in the body, while I would like to match only in the event that foo is at the beginning of the very first line of the body. I have tried regular expressions things like /^.*!.*/:b in hopes that I could test MATCH, but this finds the mime part separators or whatever that thing is called that looks like "------- Part spec blah...", while I am interested in the first user-readable pattern in the body of the email.

Anyway, any tips would be greatly appreciated, as always!

You could try /^foo/:bw as that will match the pattern against the whole body as if it were a single line.

Be aware, though, that the maildropfilter(5) manpage warns that this could use an excessive amount of CPU. This being a start-of-line search, though, it should match/fail pretty quickly and not be too CPU intensive.