Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.4: Use boolean expressions in Mail 2.0 Apps
Tiger only hintHaving read a previous poster's great suggestion for the use of Apple regular expressions in Spotlight, I thought I'd try it with Mail 2.0 Smart mailbox feature. I had a Smart mailbox that included all mail messages with xxx ANYWHERE in the Message Body. That worked well, until I realised that it excluded a few messages that could be identified just by their 'From' field.

I then edited the Smart mailbox definition by clicking on the '+' and adding From contains YYY. But the result of this is a logical AND, so that the result was it would only give me messages that contained 'xxx' in the message body AND 'YYY' in the From field.

I then edited the Smart mailbox definition to read xxx | YYY anywhere in the message, and sure enough, it found the complete set. I'm sure you can extend this with OR and NOT, but I don't know the regular expressions for these in Apple's new scheme.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[11,584 views]  

10.4: Use boolean expressions in Mail 2.0 | 18 comments | Create New Account
Click here to return to the '10.4: Use boolean expressions in Mail 2.0' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.4: Use regular expressions in Mail 2.0
Authored by: Alrescha on Wed, May 25 2005 at 10:23AM PDT
I think the original poster meant to say 'boolean' expressions, unless Mail 2.0 is a lot more flexible than I suspect.

A.

[ Reply to This | # ]
10.4: Use regular expressions in Mail 2.0
Authored by: derPlau on Wed, May 25 2005 at 2:58PM PDT
Right - these are boolean, not regular, expressions. Rob, maybe you could change the headline so grep geeks like me don't get all excited for no reason?

[ Reply to This | # ]
10.4: Use regular expressions in Mail 2.0
Authored by: da5idonimac on Wed, May 25 2005 at 11:14AM PDT
i am not sure if i am missing something, but when editing the rules for a smart mailbox, you can add multiple rules and sepcify whether one or all rules have to apply.

i see there is a problem if you have 3 or more rules and want something like (x AND y) OR z. however, in the case of the poster you could simply specify to add the email if one argument of the two applies.

[ Reply to This | # ]
10.4: It IS a bug, and exists with FILTER Rules as well
Authored by: keymaker on Wed, May 25 2005 at 12:21PM PDT

"i see there is a problem if you have 3 or more rules and want something like (x AND y) OR z. however, in the case of the poster you could simply specify to add the email if one argument of the two applies."

That's exactly what they meant. The OR (ANY) selection within mail DOES NOT WORK the way it's supposed to when you've selected the 'Entire Message' & 'Contains'. I noticed this problem immediately after upgrading 3 weeks ago and using the smart folders like a filter. By the way the FILTER RULES have the EXACT same problem.

Just as the example of what i did.

I have a smartbox with 7 parameters ranging from Subject, To, From, Any Recipients, (lets say the parameters are AAA, BBB, CCC...etc). Using OR (ANY) of the rules putting the messages into the folder, I end up with 139 emails that have at least 1 of the parameters. Duplicating a parametter, say AAA BUT for "entire message" Gave me 1 result, however, unlike the original posting here, it did NOT meet all 8 parameters. So for me at least, it did not turn the rule into a purely AND rule. Either way, as a purely OR type rule set you should never have reduced results when adding a new parameter to an OR style restriction.

I've already sent a bug report to apple, but maybe someone should send another one so they know it isn't an isolated case. I've already duplicated this problem and several computers.



[ Reply to This | # ]
10.4: It IS a bug, and exists with FILTER Rules as well
Authored by: designbot on Wed, May 25 2005 at 2:34PM PDT
This bug is very annoying, and makes the Smart Mailboxes all but useless for me. (As a side note, why can we search for messages sent by members of a certain group, but not messages sent to members of a certain group?) How do we report it to Apple?

[ Reply to This | # ]
10.4: It IS a bug, and exists with FILTER Rules as well
Authored by: n8gray on Wed, May 25 2005 at 5:14PM PDT
https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa

You will have to sign up for a free ADC membership if you haven't already.

[ Reply to This | # ]
10.4: It IS a bug, and exists with FILTER Rules as well
Authored by: pediddle on Thu, May 26 2005 at 12:15AM PDT
I agree -- not being able to search for messages TO a group makes smart folders useless for me. I'd like to have a smart folder containing all my conversations with a group, but without including sent mail, I only see half the conversation!

[ Reply to This | # ]
10.4: It IS a bug, and exists with FILTER Rules as well
Authored by: designbot on Thu, May 26 2005 at 1:06PM PDT
I posted a bug report for the smart folders, and a feature request for finding messages sent to a group.

[ Reply to This | # ]
10.4: It IS a bug, and exists with FILTER Rules as well
Authored by: moritzh on Fri, May 27 2005 at 8:55AM PDT
You are right, this is so annoying. I had 3 or 4 cool ideas about using smart folders (including what you wanted to do), but because of stupid GUI limitations such as this one I could not accomplish any of them. Sad. Smart folders are useless for me.

[ Reply to This | # ]
10.4: Use regular expressions in Mail 2.0
Authored by: designbot on Wed, May 25 2005 at 1:02PM PDT
I have encountered the same kind of bugs setting up smart mailboxes. I don't quite understand the hint, though. How do you "edit the Smart mailbox definition to read xxx | YYY anywhere in the message"? Are you saying the definition should be Entire Message > Contains > 'xxx | YYY'? And how does this get Mail to search for YYY in the "From" field? I don't understand this hint at all.

[ Reply to This | # ]
10.4: Use regular expressions in Mail 2.0
Authored by: boredzo on Wed, May 25 2005 at 2:58PM PDT
Mail does support Boolean expressions, but not regular expressions. man re_format if you want to know what regular expressions really are.

[ Reply to This | # ]
10.4: Use regular expressions in Mail 2.0
Authored by: ryo on Wed, May 25 2005 at 3:01PM PDT
The title of this hint really should be changed to something like "Use boolean expressions in Mail 2.0" since the expressions used in the examples are *not* regular expressions at all but boolean expressions (expressions using the terms 'and', 'or', and 'not').

I know it may sound pedantic, but I got really excited when I read the title and was then let-down when I read the article and found out that, no, Mail still does not recognize regular expressions. I've been hoping and waiting for OS X to have native regular expression search capabilities for a long time now - hence the let-down.

Ah Spotlight with regular expressions! How cool would that be?

[ Reply to This | # ]
10.4: Use boolean expressions in Mail 2.0
Authored by: robg on Wed, May 25 2005 at 3:20PM PDT
Sorry for the misleading title; I should have caught it in editing, but I didn't :). It's fixed now.

-rob.

[ Reply to This | # ]
10.4: Use boolean expressions in Mail 2.0
Authored by: GaelicWizard on Thu, May 26 2005 at 2:13AM PDT
I'm really amazed. This hint does not a thing in the world, doesn't make any sense, and if you are very careful to read it exactly, isn't related to Mail.app at all, since there is almost no text in the "Smart Mailbox definition", which itself doesn't refer to anything.

Rob: If you know what this guy is talking about, then rewrite the hint to be vaguely understandable. If not, then I suggest you pull it.

---
Pell

[ Reply to This | # ]
10.4: Use boolean expressions in Mail 2.0
Authored by: designbot on Thu, May 26 2005 at 1:09PM PDT
Amen.

[ Reply to This | # ]
10.4: Use boolean expressions in Mail 2.0
Authored by: mayo2ca on Thu, May 26 2005 at 1:15PM PDT
Interesting, great thing to remember.

Yesterday I found you can alter the SmartMailboxes.plist file to do nested boolean queries, for eg "Message date is today AND Message is in Mailbox Inbox OR Message is flagged". It's just matter or inserting more Criteria elements and shuffling/nesting things around. The only disadvantage is that the ability to modify the particular smart mailbox is lost within Mail. I'm currently writing an app to make it easier to modify the smart mailboxes.

[ Reply to This | # ]
10.4: Use boolean expressions in Mail 2.0
Authored by: mayo2ca on Thu, Feb 15 2007 at 10:36AM PST
I've had enough people ask me about this, so here it goes ...

I've never had time to finish, or even properly start the app. Or rather the problem is that my coding skills lack greatly in the UI/GUI realm and I never had the time to play and figure out how to render these things to make it easily editable for people. If you know of anyone, let me know, I'll be glad to work with them. I can handle the code generating the queries no problem.

I threw up a quick guide today (enough of repeating and re-writing of emails). It's not really polished yet, but by the end of today (Feb 15, 2007) it should be.

Hope this helps at least a little bit. http://oyam.ca/past/2007/2/15/complex_criteria_with_smart_mailboxes/

regards,
mayo

[ Reply to This | # ]
Boolean searches in Mail: a better explanation for non-programmers
Authored by: horhey23 on Fri, Aug 3 2007 at 10:39AM PDT
This page over at MacWorld explains exactly how to do boolean searches within Mail, with screenshots. Works like a charm with Smart Folders, you can drop these right into the entry fields in the Smart folder settings panel.

http://www.macworld.com/2006/10/secrets/novworkingmac/index.php

[ Reply to This | # ]