{"id":17207,"date":"2017-02-14T14:52:34","date_gmt":"2017-02-14T19:52:34","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=17207"},"modified":"2017-02-15T14:52:02","modified_gmt":"2017-02-15T19:52:02","slug":"on-the-uselessness-of-search-in-macos-mail","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/02\/14\/on-the-uselessness-of-search-in-macos-mail\/","title":{"rendered":"On the Uselessness of Search in macOS Mail"},"content":{"rendered":"<p><a href=\"http:\/\/robservatory.com\/on-the-uselessness-of-search-in-macos-mail\/\">Rob Griffiths<\/a>:<\/p>\n<blockquote cite=\"http:\/\/robservatory.com\/on-the-uselessness-of-search-in-macos-mail\/\">\n<p>For the last couple macOS releases, I&rsquo;ve had nothing but trouble searching in Mail. Note that I didn&rsquo;t write &ldquo;trouble searching mail,&rdquo; but rather, &ldquo;trouble searching <em>in Mail<\/em>.&rdquo;<\/p>\n<\/blockquote>\n<p>Searching Spotlight directly works for him.<\/p>\n<p><a href=\"https:\/\/twitter.com\/DanFrakes\/status\/831247248063205380\">Dan Frakes<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/DanFrakes\/status\/831247248063205380\"><p>Is there a secret to getting macOS Mail&rsquo;s &ldquo;Unread&rdquo; smart mailbox to show 0 messages when there are no unread messages?<\/p><\/blockquote>\n<p>I see both of these issues all the time, though with the Flagged smart mailbox rather than Unread. The number next to the Flagged mailbox is different from the number of messages shown in that mailbox, and some of the messages shown in it are not actually flagged.<\/p>\n<p>As a quick fix to prevent it from showing messages that are not actually flagged, I was able to use this Terminal command:<\/p>\n<pre>sqlite3 ~\/Library\/Mail\/V4\/MailData\/Envelope\\ Index 'SELECT * FROM subjects WHERE rowid IN (SELECT subject FROM messages WHERE flagged=\"1\")'<\/pre>\n<p>After confirming that these really are messages that should not be flagged, I could mark the messages as unflagged:<\/p>\n<pre>sqlite3 ~\/Library\/Mail\/V4\/MailData\/Envelope\\ Index 'UPDATE messages SET flagged=\"0\" WHERE flagged=\"1\"'<\/pre>\n<p>(Caveat: I do not use multi-colored flags and have not investigated how this affects them.)<\/p>\n<p>This would only provide temporary relief, though. <a href=\"http:\/\/c-command.com\/spamsieve\/help\/how-can-i-rebuild-apple\">Rebuilding<\/a> Mail&rsquo;s database takes longer but also lasts longer. But because of this and other problems that wouldn&rsquo;t fully go away, I did a clean reinstall of macOS about a week ago. So far so good, but I suspect that both problems will be back.<\/p>\n<p>Fortunately, most of the mail that I need to search is in <a href=\"https:\/\/www.fogcreek.com\/fogbugz\/\">FogBugz<\/a> and <a href=\"http:\/\/c-command.com\/eaglefiler\/\">EagleFiler<\/a>.<\/p>\n<p>Update (2017-02-15): <a href=\"http:\/\/robservatory.com\/a-possible-fix-broken-search-in-macos-mail\/\">Rob Griffiths<\/a>:<\/p>\n<blockquote cite=\"http:\/\/robservatory.com\/a-possible-fix-broken-search-in-macos-mail\/\"><p>If I move all the messages from an inbox or local storage folder into a different local storage folder, they&rsquo;ll be indexed and findable. I can then move them back into the inbox or source folder, and they remain findable.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Rob Griffiths: For the last couple macOS releases, I&rsquo;ve had nothing but trouble searching in Mail. Note that I didn&rsquo;t write &ldquo;trouble searching mail,&rdquo; but rather, &ldquo;trouble searching in Mail.&rdquo; Searching Spotlight directly works for him. Dan Frakes: Is there a secret to getting macOS Mail&rsquo;s &ldquo;Unread&rdquo; smart mailbox to show 0 messages when there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[126,131,30,1381,343,1042],"class_list":["post-17207","post","type-post","status-publish","format-standard","hentry","category-technology","tag-applemail","tag-bug","tag-mac","tag-macos-10-12","tag-search","tag-spotlight"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=17207"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17207\/revisions"}],"predecessor-version":[{"id":17222,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17207\/revisions\/17222"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=17207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=17207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=17207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}