Add mailbox(es) script not working in Mail 7 with gmail

I’ve discovered that the "add mailbox(es) script doesn’t work with Mavericks Mail.app 7 and DTP. I get a flash and go to DTP, but nothing is added. If I select a mailbox in Mail.app that is NOT a gmail mailbox, it imports as expected. This is true with the “updated” Mail.app BTW, the one Apple just issued. I’m using all IMAP mailboxes if that matters. Again, the script works fine with other IMAP accounts I have (iCloud, Yahoo, easyMail) just not with gmail.

Any ideas for a work-around? I really want to get these emails into DTP since Mail.app with gmail has become so problematic. If I go to ~/Library/Mail/V2 and import the account folder there I end with the folder structure for the mail library, which is quite unhelpful. The script for selected individual messages also doesn’t work.

Hello robgendreau

I had a similar problem after applying the latest mail update for Mavericks. When trying to run mail after the update I got a message saying that the Devonthink mail plugin was disabled as it needed to be updated.

This message, and possibly yours situation, indicates the plugin may need updating for the latest UUID (a unique identifier for compatibility with Mail) . You will have to find this UUID, and then add it to the info.plist file for that plugin.

  1. Identify the UUID - go to your Terminal application and run:

defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID

You should get a long number, a UUID that you will need.

  1. You might also have another related UUID, run this command in the Terminal to get it:

defaults read /System/Library/Frameworks/Message.framework/Resources/Info PluginCompatibilityUUID

  1. Go to your home plugin folder for Mail at: ~/Library/Mail
    You should see a folder called Bundles (Disabled). Look in here and see if you have a Devonthink plugin eg:

DEVONMailConduit-SnowLeopard.mailbundle

  1. If you have a Devonthink bundle - look inside the bundle and find the file called info.plist. Open it with a plain text editor like textedit or textwrangler. You will see something like:
    SupportedPluginCompatibilityUUIDs

    0941BB9F-231F-452D-A26F-47A43863C991
    B3F3FC72-315D-4323-BE85-7AB76090224D

You may have one or more strings with numbers.

  1. Add in a line for the UUID you found in step 1 (and in step 2 if it exists)

  2. Save the file. Move the whole Devonthink plugin back into the Bundles folder instead of Bundles (disabled) eg ~/LIbrary/Mail/Bundles.

  3. Close down your Mail and then restart it.

This fixed the issue for me. However, if your plugin relies on something that might have been changed in the latest Mavericks mail update it may still not work and require a fix to be issued.

I don’t have any such bundle in any of the disabled bundles folders (in a couple of places, like ~/Mail and ~/Mail/V2). Where does one get it? I ran the DTP>Preferences option to install all plugins and such a few times, all post-Mavericks.

Rob

The Mail plugin is compatible with Mavericks. Apple’s procedure for OS X upgrades (and often, updates as well) is to automatically kick out all Mail plugins, even compatible ones.

When this happens, just run the Install Add-Ons procedure again.

Hi Bill_DeVille,
I did think that too however on this occasion every time I ran the Add-Ons procedure Mail would kick me out and report that the Mail plugin was not compatible with version 7.0. In the end updating the UUID was the only thing that worked for me.

Cheers,

I could be mistaken, but I believe the OP is asking about the Applescripts for Mail that are included with DEVONthink Pro and Pro Office, while the responses are targeted to the Mail plugin that is included only with DEVONthink Pro Office.

Confirmed. The script gets to this point


set theCount to theCount + (count of messages in theMailbox)

within this handler


on countMessages(theMailboxes)

and returns “0” for the count of messages. Because the script does not see that there are messages (i.e., the count is zero), then it stops. Clearly more extensive debugging by DEVONthink might solve the problem – but Gmail in Mavericks Mail is still very broken, IMO, even with the Mail update “v 1” of a couple days ago.

[size=85](Just off the point – but I’m curious why @icedlava suggests that hacking DEVONtech’s plugin code in order to make it work is a good idea. The code might be broken (however, in this case it is not – see Bill DeVille’s advice which has been true for every OS X Mail update since forever), and one can certainly do to one’s personal copy of the software whatever one wishes, but whoever reads the advice needs to be aware that changing a plugin might make further support impossible. Not meaning to be critical and just my opinion.)[/size]

Thank you Greg_Jones for pointing that out - it is the case I believe.

I’ve just discovered that script myself now and confirm the issue described.

Just to clarify one point that I made, the scripts are included with both Pro and Pro Office, while the plugin is Pro Office only. I’ve edited my original post to reflect this.

[size=85](Just off the point – but I’m curious why @icedlava suggests that hacking DEVONtech’s plugin code in order to make it work is a good idea. The code might be broken (however, in this case it is not – see Bill DeVille’s advice which has been true for every OS X Mail update since forever), and one can certainly do to one’s personal copy of the software whatever one wishes, but whoever reads the advice needs to be aware that changing a plugin might make further support impossible. Not meaning to be critical and just my opinion.)[/size]
[/quote]
Hi Korm,

Bill DeVille’s advice is correct as you say, however it just does not work in this case on my mac - Mail refused to load without disabling the plugin after multiple attempts at reloading (other 3rd party plugins were fine). The mail update did not seem to compromise the plugin code so, it seemed one possible reason it may not run was the need for an updated UUID. I’d checked the forums here and there was no sign of any fix or anyone else having issues with it however I needed it working. I didn’t touch the code itself and as the updated UUID worked perfectly for me, I thought I’d suggest it when I saw someone else having problems (of course it was my bad - wasn’t the plugin that was the issue here! Apologies for the confusion).

Yes, to confirm it IS the script and it is DTP, not DTPO so no plugin.

Gmail implementation is still hideous in Mail.app 7 even with the update. It’s like Google is into tags, and Apple into folders, and translating back and forth is not making anyone happy. I’ve got all sorts of what appear to be mailboxes with just plists; it’s as if they’re using virtual folders now in lieu of gmail tags. I sure wish I could store email outside of the library structure of Mail, a la iPhoto or iTunes, and just reference it.

But that’s what DTP is for :smiley:

Just wish it would work with Gmail (works with “On My Mac,” iCloud and easyMail (DNS/ Mail provider; very nice at $40/yr). It’s just the Gmail IMAP that doesn’t seem to work.

I’m not sure that this is an easy fix; in exploring the folder structure I saw more than one mailbox of the same name for the same account in two different places; I’m guessing that one holds the copies of gmails that Mail app used to produce (a search seems to turn up only older files). I’m further surmising that Mail.app now stores the email files in [Gmail]All Mail and the folders are only referencing the emails you see in Mail.app within those folders. I’ve run the script successfully on a test Gmail All Mail box (my main account has WAY too many files to test on), but that’s the only one in Gmail so far that works.

I’d try it with a Smart Folder but those aren’t working for me with Gmail either, and if I manage to get one set up with gmails in it and run the script it fails as well.

It’s gonna be a mess if Gmail is structured differently than the other IMAP servers.

Rob