Using advanced search logic in Gmail filters

filterfailI just stumbled on a way to munge more detailed logic in Gmail filters, and in the interest of being a Mr Clever Trousers,  this is me sharing.

I was trying modify a filter to operate on emails that were sent to a particular address A or recieved from a particular address B. After entering the relevant information in the To: and From: text boxes I discovered that the filter conditions appeared to have a logical AND applied to them by default. Shock! Rage! Despair!

filterwin1After throwing a short (but undeniably violent) tantrum, I tried using the advanced mail search operators I had come across while investigating the Multiple Inboxes  lab feature, by appending additional logic (OR to:someotherguy ) to the condition in the From: text box.

Success!

It looks like the back end that collates the filter just takes the appropriate modifier for a field (from: in this case) and then just appends whatever is in the associated text box (someguy OR to:someotherguy) , so any additional search logic gets included in the filter. A bit like exploiting a buffer overflow. But in a nice way.

Advertisements

About this entry