Jump to content

Mail.app search by author, subject or content [For macOS Mojave & earlier]


Recommended Posts

18 hours ago, sumin said:

I found my ~/Library/Mail/ doesn't contain any files in it,

 

Make sure that you're navigating to your user directory's ~/Library/ and not the main Macintosh HD Llbrary.

 

Quickest way to do this is to paste the ~/Library/Mail/ path into Alfred, in fact :)

 

Don't move anything, as Mail's files need to be where Mail expects them to be. Just make sure Mail is set up with your accounts, then take a look at the path above ensuring you're definitely in the right user directory, and we'll take it from there.

 

Also, please let us know which version of macOS and Alfred you're using.

 

Cheers,
Vero

Link to post
  • 3 weeks later...
  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Thought I should share this workflow to search Mail.app   Use the following keywords to search: emfrom to search the sender's name and email address em for a general subject + c

Any update on the sorting issue?  This is a great workflow, but not having the emails sorted by date does make this workflow less valuable.  For instance, I search for a subject, and the list returns

There is no sorting as such as the workflow returns them in the order OS X feeds them back, but you can have a play with date ranges   You can create additional keywords and go to the file filter's

Posted Images

Just sharing my own experience: 

I had "no results and fallback to default search" until I granted "Full Disk Access" rights to Alfred. You can do that in System Preferences/Security & Privacy/Privacy/Full Disk Access. Click the padlock icon to allow changes, then drag Alfred to the app list on the right. Make sure it's checked, restart Alfred, done. Voila, work like charm.

 

This is MacOS Mojave 10.14.3 and Alfred v3.8

 

Thanks for the great wf, @Vero

Edited by Indolamine
Link to post
  • 1 month later...
  • 1 month later...

Mine keeps going to the default (google) search engine. I use emfrom > enter > use name of a contact who is in my contacts and who has many emails. 

 

Here's a screenshot of Alfred with the input ready.

 

Mojave 10.14.3

Alfred 3.8.1

Alfred checked in Accessibility

 

Any ideas?

 

Thanks.

Screen Shot 2019-05-14 at 1.34.15 PM.jpg

Link to post

@Tonycr46 As a basic check, are you using Mail.app for your email? This workflow is intended specifically for users who use Mail.app, and won't find results from other email clients or web-based email sources. :)

 

If you're indeed using Mail, can you please try the various keywords with the simplest search term possible you would expect to find?

 

This file filter is very simple:

  • It searches for com.apple.mail.emlx files
  • In the search scope ~/Library/Mail

Take a look at the objects in the workflow to see if any need changing for your particular configuration.

 

You can also check that your Mac's metadata is complete and that using the Alfred Metadata Tool (https://cachefly.alfredapp.com/tools/AlfredMetadataTool_v1.1.zip), your email files show the correct file type and are in the correct location.

 

If the metadata doesn't seem complete, then rebuild your Mac's index, and you should be good to go :)

 

Cheers,
Vero

 

 

Link to post

Thanks, Vero.    

 

Yes. I'm using mail.app. I haven't made any changes to it as far as the default locations. 

 

Something that probably has a bearing on it and I can't figure out how to fix it is that Spotlight is not coming up with emails when I search and the search in Mail doesn't even offer to search for addresses or senders. The only thing the search in Mail will search for is text. It seems like Spotlight is not indexing the email, but I've spent hours trying the different suggestions people have to get this to happen.

 

I have a Mac running High Sierra and everything works fine (Spotlight, your Alfred workflow and Mail search). As I said, I do have the accessibility enabled on the Mojave machine. 

Link to post

@Tonycr46 If Spotlight isn't returning results, then that's the source of your issue; Alfred (and any other third-party app relying on the same metadata index) won't be able to find results either.

 

You haven't said what kind of metadata can be seen if you install the Metadata Tool as I recommended, but I'm assuming there's some corruption there.

  • First, launch System Preferences > Security & Privacy > Privacy > Full Disk Access
  • Add Terminal to the list of apps
  • Launch Alfred's preferences to the Advanced tab, click "Rebuild Metadata index" and check the box for "Delete /.Spotlight-V100"
  • When Terminal launches, enter your password and hit return
  • Keep an eye out for any error messages, and let us know if there are any
  • Wait an hour or so to allow your Mac's index to be rebuilt

You should now have a freshly rebuilt index, and Alfred, Spotlight and others should return results.

 

Cheers,
Vero

Link to post

Thanks, Vero.

 

I haven't run the Metadata tool since I am working on the High Sierra machine right now. When I go into the office tomorrow, I'll check that.

 

Appreciate the help. Will let you know in a few hours (I'm GMT +7).

Link to post
  • 3 months later...
10 hours ago, musi003 said:

All my searches are falling back to google search...

 

Could you please provide a screenshot of the Mail workflow so that we can see the keywords (if you've modified them)?

 

Also, can you let us know exactly what you're typing into Alfred, and what results you're expecting?

 

Finally, which version of Alfred and macOS are you using?

 

The more information you can provide, the more likely we'll be able to help you troubleshoot the issue on your Mac. :)

 

Cheers,
Vero

Link to post
  • 5 weeks later...

Hello, 
I am using Alfred 4.0.4 [1111] with macOS 10.15 and the workflow Mail.app Search v3 does not work. The first letter after emfrom immediately shows the standard search.
Alfred's Metadata Tool seems to show the meta data correctly and the permissions are set correctly. 
~/Library/Mail is entered.

Are there any known problems with this workflow and Catalina?

Many greetings
sgs
 

Link to post
2 hours ago, dfay said:

 

macOS 10.15 Catalina bans third-party applications from searching the Mail.app Spotlight index. On macOS Catalina, HoudahSpot will thus no longer be able to find your Apple Mail messages.”

 

And the reasons for not moving to Catalina just keep on coming. Got High Sierra on one machine and Mojave on two others. Going to stay there for a long time.

Link to post

In macOS Catalina, Apple have removed access for third-party apps to Mail.app results by excluding it from the Spotlight metadata that apps like Alfred can use to return results. As such, the workflow won't return any results, as macOS no longer returns any Mail results.


Here's a thread including responses from an Apple employee explaining what's happened to the Spotlight index. Within this thread, there's a somewhat possible workaround of copying the Mail folder to a different folder within your Home folder (e.g. in Documents), it becomes indexable. However, we can't advise doing this and you'd be doing so at your own risk, as it could cause other issues.

 

https://forums.developer.apple.com/thread/121187#379221

 

We are hopeful that Apple will realise that this is necessary to third-parties and bring this back. 

 

Cheers,
Vero

Link to post
  • 3 months later...
  • 1 month later...
  • 6 months later...

HoudahSpot just updated to version 6.0 which re-instates mail search via their own Mail.app plug in. Bit clunky but once installed works perfectly.

It also now has an instant search bar à la spotlight/alfred but can't be pre-configured to search mail as far as I could see so would require 'mouse fiddlin' every search.

 

Could Alfred have a Mail.app plug in possibly?

Link to post
12 minutes ago, funkymonkey said:

HoudahSpot just updated to version 6.0 which re-instates mail search via their own Mail.app plug in. Bit clunky but once installed works perfectly.

It also now has an instant search bar à la spotlight/alfred but can't be pre-configured to search mail as far as I could see so would require 'mouse fiddlin' every search.

 

Could Alfred have a Mail.app plug in possibly?

 

We're aware of this and have also investigated the possibilties earlier this year, but as this plugin solution relies on private APIs (which can stop working at any moment, as the goalposts may be constantly moving, changing or simply disappearing), we don't plan on adding this.

 

I responded more fully in this thread:

 

 

As TJ adds in his reply, "building a tool like this is like building a house on sand".

 

Cheers,
Vero

Link to post
  • Vero changed the title to Mail.app search by author, subject or content [For macOS Mojave & earlier]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...