I have a dozen or so SVN projects that generate a few dozen email messages every day, each with subject line like this "[SVN projectname] in branch/trunk list of files".
I want to send these email messages to a folder automatically (for weekly review), but if somebody sends me a comment regarding an SVN commit (which typically has subject line "Re: [SVN projectname] ...") then I don't want to send the message to the folder, since it is likely to require immediate action.
My question is: what is the best way to address this gmail filtering requirement?
Simply specifying a gmail filter that sends messages with subject [SVN projectname] to a folder is too general, because such a filter will take both the messages that I want to filter and some (like the Replies mentioned above) that I don't want filtered. I would describe the "pattern" I want like this:
I am aware that full regular expression filter support is both resource intensive and prone to security holes, which is why I've chosen the example (which is real, by the way) carefully - the "left anchor" pattern is the easiest and most efficient (to implement) type of text matching pattern that I can think of (except maybe a check on minimum/maximum string length).
I am also aware that I can use the "From" filter (and in some cases the "To" filter) to distinguish between messages which are automatically generated by SVN and messages which are generated by humans (and indeed, that is my current "workaround" for the fact that I cannot use a better filtering pattern for the subject line). But IMO this is not a real solution, because it means that I must tweak my mail filtering rules each time we change the hosting location of an SVN repository, for example - and if I write filters based on "To" then I need to tweak them when we change our email aliases.
Indeed, the very existence of "To" and "From" filters in gmail acknowledges that email headers contain metadata which naturally calls for "fielded search" as opposed to the "(free) text search" which works so well for the message body. But in order to dissect the elements of an email workflow we need pattern matching which is sensitive enough to distinguish between an "original" message and a "reply", and it has been standard email client behavior for many years to encode this in the construction of the subject line. So it seems silly that we cannot take advantage of this fact when writing our gmail filters.