jaacob Posted July 11, 2016 Posted July 11, 2016 Is it possible to search emails within Postbox 4 from Alfred 3?
Vero Posted July 12, 2016 Posted July 12, 2016 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
Stephen_C Posted July 13, 2016 Posted July 13, 2016 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: Enabling Spotlight search in Postbox (Postbox > Preferences > General and check Allow Spotlight to search messages). 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
dfay Posted July 13, 2016 Posted July 13, 2016 If you run mdls on a message, what are the metadata fields displayed? (see https://www.macissues.com/2014/05/12/how-to-look-up-file-metadata-in-os-x/ ) If Postbox is saving the metadata in a form Spotlight (for which mdls is part of the backend) can read, then it should be fairly straightforward to set it up along the lines of Vero's workflow above.
Stephen_C Posted July 14, 2016 Posted July 14, 2016 (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 = 501kMDItemContentCreationDate = 2016-07-14 08:40:03 +0000kMDItemContentModificationDate = 2016-07-14 08:40:03 +0000kMDItemContentType = "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 +0000kMDItemDisplayName = "From London"kMDItemFSContentChangeDate = 2016-07-14 08:40:03 +0000kMDItemFSCreationDate = 2016-07-14 08:40:03 +0000kMDItemFSCreatorCode = ""kMDItemFSFinderFlags = 0kMDItemFSHasCustomIcon = (null)kMDItemFSInvisible = 0kMDItemFSIsExtensionHidden = 0kMDItemFSIsStationery = (null)kMDItemFSLabel = 0kMDItemFSName = "54736DB1.8020000%40[redacted—but my domain name].co.uk.pbeml"kMDItemFSNodeCount = (null)kMDItemFSOwnerGroupID = 20kMDItemFSOwnerUserID = 501kMDItemFSSize = 1678kMDItemFSTypeCode = ""kMDItemKind = "Postbox Mail Message"kMDItemLogicalSize = 1678kMDItemPhysicalSize = 4096kMDItemTitle = "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 July 14, 2016 by Stephen_C
dfay Posted July 14, 2016 Posted July 14, 2016 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.
Stephen_C Posted July 14, 2016 Posted July 14, 2016 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: I am a beginner with Alfred; and 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 dfay 1
Vero Posted July 15, 2016 Posted July 15, 2016 Yes...undoubtedly! However as: I am a beginner with Alfred; and 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!
Stephen_C Posted July 15, 2016 Posted July 15, 2016 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now