Jump to content

Search Postbox 4 emails from Alfred?


Recommended Posts

Posted

Is it possible to search emails within Postbox 4 from Alfred 3?

 

 

I've had a look through available workflows and forum archives and haven't found a workflow for Postbox (including looking for older versions that may have been easy to modify).

 

If you can find out (through your own research or contacting Postbox) 1. whether Spotlight indexes emails from Postbox and 2. where this data is located, you should be able to create a file filter workflow to search for your emails in a way similar to my existing Mail workflow:

https://dl.dropboxusercontent.com/u/5818788/Alfred/Mail.app%20Search%203.0.alfredworkflow

 

Cheers,

Vero
Posted

I am a new user of Alfred (a few weeks or so) but have used Postbox for a number of years. Because of my lack of experience with Alfred you may need to take what I say with a pinch of salt. :)

 

That said, a couple of weeks ago I did look at the possibility of using Alfred to search Postbox emails. I got as far as:

  1. Enabling Spotlight search in Postbox (Postbox > Preferences > General and check Allow Spotlight to search messages).
  2. Experimenting with the mail workflow referred to in the preceding post to see if I could produce meaningful results from Postbox search.

It all came rather adrift when I was unable to discover the appropriate metadata fields to direct the search—so that in effect all I was able to search was for the occurrence of text within a mail message (if I recall correctly). (In other words, I never discovered how to search message headers, senders or recipients.) I'm afraid at that stage I rather pathetically gave up—partly because search within Postbox itself is so efficient. Sorry this is not more helpful!

 

Stephen

Posted (edited)

Thanks for the really helpful response. I have waded in to all of this well out of my depth :)  but have made progress—purely as a matter of interest, as personally I'm happy to rely on the native Postbox search. I've managed to adapt the original workflow successfully to search either mail content or subject header with no problems. What I suspect is not possible is to search by author—because there appears to be no metadata item which will easily yield that information in a user friendly form. This is a sample of the output of the mdls command:

 

_kMDItemOwnerUserID            = 501
kMDItemContentCreationDate     = 2016-07-14 08:40:03 +0000
kMDItemContentModificationDate = 2016-07-14 08:40:03 +0000
kMDItemContentType             = "com.postbox-inc.postbox.pbeml"
kMDItemContentTypeTree         = (
    "com.postbox-inc.postbox.pbeml",
    "public.data",
    "public.item",
    "public.content",
    "public.email-message",
    "public.message"
)
kMDItemDateAdded               = 2016-07-14 08:40:03 +0000
kMDItemDisplayName             = "From London"
kMDItemFSContentChangeDate     = 2016-07-14 08:40:03 +0000
kMDItemFSCreationDate          = 2016-07-14 08:40:03 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = (null)
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = (null)
kMDItemFSLabel                 = 0
kMDItemFSName                  = "54736DB1.8020000%40[redacted—but my domain name].co.uk.pbeml"
kMDItemFSNodeCount             = (null)
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 1678
kMDItemFSTypeCode              = ""
kMDItemKind                    = "Postbox Mail Message"
kMDItemLogicalSize             = 1678
kMDItemPhysicalSize            = 4096
kMDItemTitle                   = "From London"

 

As I say, I was really doing this out of interest to see if I could assist the original poster so please don't spend time on it just for me! It's been an interesting exercise in any event—& the article to which you linked was very useful. Thanks again.

 

Edit: a little more research has disclosed that the author details are embedded in kMDItemTextContent string—so the content search will also pick up the author of the email.

 

Stephen

Edited by Stephen_C
Posted

Hmm....running it on an Apple Mail message .emlx gives fields like this, which allow for a lot more granularity in the search:

 

kMDItemAuthorEmailAddresses            = (

    "aperson@ucr.edu"

)

kMDItemAuthors                         = (

    "That Person"

)kMDItemRecipientEmailAddresses         = (

    "someone@ucr.edu"

)

kMDItemRecipients                      = (

    "Faculty (somepopele@server.ucr.edu)"

)

kMDItemSubject                         = "pithy but informative subject line"

 

So the kMDItemTextContent may be the best you can do.  If you wanted to push it you could probably find a regex to parse the email out of the text field.

Posted
 If you wanted to push it you could probably find a regex to parse the email out of the text field.

 

Yes...undoubtedly! However as:

  1. I am a beginner with Alfred; and
  2. I don't really need the workflow I seem to have developed

I may leave that for the moment. Nevertheless, I'd not have got this far without your help—which is much appreciated.

 

Stephen

Posted

Yes...undoubtedly! However as:

  1. I am a beginner with Alfred; and
  2. I don't really need the workflow I seem to have developed

I may leave that for the moment. Nevertheless, I'd not have got this far without your help—which is much appreciated.

 

Stephen

 

 

Good work Stephen (and thanks for your help, dfay) - You'll now have a better grasp of how you can use file filters for your own purposes later on :)

 

As a final note, it's always worth getting in touch with the developers of apps you love; Ask nicely for the feature/tweak you're looking for and explain a scenario where it's useful. They won't always say yes, but there's no harm in asking. It's been a few years since we talked to them, but I recall the Postbox team being very nice!

Posted

As a final note, it's always worth getting in touch with the developers of apps you love; Ask nicely for the feature/tweak you're looking for and explain a scenario where it's useful. They won't always say yes, but there's no harm in asking. It's been a few years since we talked to them, but I recall the Postbox team being very nice!

 

Thanks for that idea. I've submitted a feature request on the Postbox site asking if it's possible to have a metadata tag specifically identifying the author of an email and have linked that request to this thread.

 

Stephen

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...