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.