Category Archives: Mac OS X

OS X Mountain Lion Mail and Smart Mailbox Syncing

Last night, I was reading the Ars Technica review of Mountain Lion, which included the following quote about iCloud:

Then there’s debugging. Sure, this is all supposed to “just work.” But when it doesn’t, even expert users have very little recourse. To help with cases where a particular device is not showing the data that you expect to see, traditional cloud storage services provide a Web interface to the canonical data store. Even Apple’s own iDisk did this. Currently, iCloud provides no such interface.

That certainly rang true in a bizarre problem for me today. I have two machines that were setup independently and both upgraded to Mountain Lion. I make extensive use of Smart Mailboxes to be able to run through certain lists of mail quickly – one of them includes every open source commits list that I subscribe to. When I went to check that on my second machine yesterday, it was empty – and the Smart Mailbox showed that every rule said “No mailbox selected”. I hadn’t used that mailbox on there since the upgrade, so I figured it was probably an upgrade problem – and went ahead and fixed it.

Then I moved back to my iMac this morning and found it had the same problem. I still had the Macbook open and saw that it was all working there, so I fixed it up on the iMac. Almost instantly, I watched it break on the Macbook.

Well, that’s creepy.

With the help of this post, I discovered that Mail now syncs Smart Mailboxes to iCloud (I suppose using the key-value store, as this is for non-iCloud mail accounts). Inspecting the properties files mentioned, I found that the IMAP URLs for the folders differed between the two machines – one using and the other The sync would merge them, and whichever had the account setup differently would fail.

All I had to do was change the IMAP server so both accounts matched, then edit the smart mailbox (without changing anything and pressing Ok). It would be updated to the new server address and synced, magically repopulating on the other machine.

Syncing Smart Mailboxes is an awesome feature that I was wishing for when setting up the Macbook a few weeks ago – and I hadn’t heard about it prior to today. I think the transparent sync is going to be a great thing as more apps add support for it, but hopefully there’ll be more attention paid to making it clear where it is going to happen, and dealing with conflicts. In this case, it was expected behaviour, but it looked like an awful bug in Mail at first glance.

Hopefully this info will avoid someone facing the same confusion!

Other than that, the upgrade has gone really well. In the past I’ve written long blog posts about what was required to upgrade – this time it is basically identical to Lion. Reinstall Java, reinstall Xcode command line tools, done. Now to start playing with new features…


Obligatory OS X Lion Installation Post

A couple of years ago, I wrote up my experiences installing Snow Leopard on my MacBook Pro. With Lion out today, I’m doing the same (either as notes to self, or to help out other poor souls).

This time around I have two machines to install, so the rarely used MacBook is getting updated now, with the iMac on hold for a while so I don’t disrupt work. I’ll be well prepared for that one with both a Time Machine backup and a clone by Carbon Copy Cloner to a different portable drive!

Getting It

In my previous post, you’ll see I had some hassle getting a functional install disc for Snow Leopard. In that light, digital distribution was a welcome change – particularly being able to start downloading it in the middle of the night here as soon as it was out, and having it ready when I woke up. There were a few false starts with the App Store overloaded initially, but once it got purchased the download was fast.

You can check download progress in the “Purchases” tab – though since the store was timing out I found it easier to look in ~/Library/Application Support/AppStore/APPID. Note that this changes after the upgrade to Lion – instead being in a temporary directory (for me, it was $TMPDIR/../C/

Once it was downloaded, I made sure to copy the install application to a thumb drive, so that I can install it on the desktop later without another hefty download. You’ll want to grab that before you actually install, as it appears to be gone afterwards. While I haven’t tried it yet, there’s plenty of instructions out there for installing from physical media – such as this one (though this isn’t necessary, as you can just run the install app again on the other Snow Leopard machine).

The Install

The install process is very similar to that of Snow Leopard, though I had no problems such as I did that time. It spent its 45 minutes installing, rebooted, and came back to the new login screen.

The Victims

Here’s what I’ve found didn’t work out of the box:

  • X-Code command line tools
  • Homebrew (by virtue of the above)
  • Java
  • Java applets
  • AUSkey (required Java applets)
  • TruePreview (Mail extension to avoid marking as read immediately, will have to live without it for now)
  • Skype had some UI glitches related to scrolling (upgrading to 5.2 fixed it)
  • The Omnifocus mail integration (re-installed from OmniFocus preferences again)
  • The Basics Growl style (text always comes up black, switched to the “Mono” theme from the same site instead)

Parallels went out of their way to email today and say that my old copy of Parallels Desktop 4 won’t work in Lion, though I’m yet to try it. VMWare only refers to version 3.1.3 being fine, but I still seem to be able to run Fusion 2 just fine as a host – though it’s falling behind on guest support. I should be able to keep using that. I’m not inclined to pay for an upgrade, so it might be time to try VirtualBox again.

Some other things that I had previously been using (like MailTags and Mail Act-on) didn’t survive the Snow Leopard upgrade, so that made things simpler. One or two (like Dovecot) I won’t find out until I try again on the iMac.

Xcode Command Line Tools

This has been a problem for a while – each new release you could get a smaller download from Software Update, or the multi-gigabyte one from the Developer Center. Putting the smaller download on multiple machines meant intercepting the download to copy it before the update got erased, though – and it felt like it wouldn’t last forever.

That seems to be the case now – with Xcode 3 not working on Lion, I bit the bullet and got Xcode 4.1 from the App Store. It’s a large download, but the good news is that after “installing”, it just puts an “Install Xcode” application in place, like Lion itself. You can then copy that around to install elsewhere (though I’m yet to try – we’ll see if the App Store still recognises it).

This installs Xcode as well as the command line tools – I’m not sure at this point if there is a leaner option.

The installer has some oddities though. First, it requires that you close iTunes even if it isn’t running – to correct that I had to kill iTunesHelper from the command line. Beyond that, it seems to get stuck at the very end of the progress bar and never ends. I closed the window and everything seems installed, but it hasn’t removed the installer application.


After updating Xcode, brew doctor seemed happy again, so nothing more to do there.


The concern about Java not being installed on Lion seemed to have died down, and it was pretty much a non-event in this case. After installation, I immediately went to a terminal and typed “java”, at which point it prompted to download it for me, and worked just fine after that.

Java Applets

It was a bit unclear at first why, but pages with applets weren’t working in either Safari or Chrome. I found that I had to go to the “Java Preferences” panel and check the box that allows applets, as they had been disabled by default.


I’m sure I’ll find several issues as I go along, but for now it has been fairly limited.

  • Chrome has the button to go fullscreen, but not the one to go back and permanent scrollbars (this has now been written about)
  • Colloquy 2.3 has the same scrollbar problem, and displays all times in UTC. The 2.4 release from seems to resolve them but hasn’t been announced yet (but must be close!)
  • My original desktop background disappeared on the iMac (fine on the Macbook), replaced by a starfield, and today replaced by a blank blue background. This seems to be a result of setting it from iPhoto ’09 – exporting and setting by right clicking on the JPEG worked

The Verdict

My initial impression of Lion seems to fit with the majority of the observers – a worthwhile upgrade for the price. I haven’t used it enough to really say yet. The feature I’m most looking forward to seeing in practice is the document versioning and application state restoration, but it’s not that useful when it’s only in TextEdit right now.

The UI changes make sense to me so far, though I had to forcefully hide the scrollbars for the reverse swiping to make sense again (the default for the old Macbook trackpad was always on). Honestly the UI changes don’t really excite me a lot either – it overall doesn’t feel too different to Snow Leopard.

The new 3-pane interface and threaded view in Mail is welcome, though otherwise there doesn’t seem to be too much different in this release. I might try iChat over Adium for a while again to compare, since it now supports all those old Yahoo messenger buddies I have.

Aside from that, I’m not going to bother reviewing the features, as plenty have done that so far (the most detailed as always being John Siracusa at Ars Technica).

Hope this helps someone!

Using a GPG agent for signing Maven releases on Mac OS X

Using the Maven GPG Plugin makes it easy to sign a large number of artifacts when performing a release with Maven.

However, one of the annoying parts is that interactive password entry is not particularly easy, and you often have to put it on the command line or into your settings file in plaintext, which is not very comfortable. The better alternative is to use gpg-agent, and if you’re not using GPG 2.0 this needs to be configured in the POM:


GPG will fallback to the same password entry if it is not running or if it is provided via the property, so there’s no particular downside to enabling the option.

The problem on Mac is that the situation with GPG is a little confusing. There seem to be several different projects floating around to provide it.

I’m a big fan of Homebrew, and previously I’d been using that to install GnuPG and gpg-agent. It worked quite well, but the password entry required curses, and also didn’t work in an interactive session – so you’d need to make sure to have entered it manually before starting a release. If it failed mid-release, you’d need to restart the agent. None of this was Homebrew’s fault – I just hadn’t been able to find a native pinentry app for the Mac that stood alone and didn’t crash on use.

After fiddling with it for a while, I decided to try one of the native Mac GPG installers again. This is where it got confusing, since there are several efforts floating around. Others may work, but the one I had success with is the revived GPGMail project. After uninstalling all the packages using Homebrew, I installed GPGTools from the download page. Since this includes a native pinentry application, and pre-configures gpg and the agent to run once on login, it worked much better.

The only catch if you’re trying this is that you need to logout, or in your shell run this until you have:

open /usr/local/libexec/
. ~/.gpg-agent-info

You can test that it is working outside of Maven by running: gpg -ab (ending with Ctrl-D),

Selenium Maven Plugin 1.0.1 Released

The Selenium Maven plugin 1.0.1 has been released, to correspond with the recent Selenium 1.0.2 release. Mac & Firefox users rejoice!

Here are the changes that were included:

  • [MSELENIUM-59] – Selenium server could not be stopped from stop-server goal
  • [MSELENIUM-60] – Fails to run with Firefox 3.5 on OS X 10.6.2
  • [MSELENIUM-58] – docu is outdated: there is no parameter multiWindow anymore

Snow Leopard Installation Journey

Wow, long time between posts… well, no time like the present and I thought I’d share a my notes on the Snow Leopard upgrade in case it helps anyone else.

The rant

Firstly, the obligatory rant. I had a world of pain just getting to the install process. After my initial disc was promptly shipped out, it turned out to be from a bad batch. The first support rep recommended trying again and if it failed to call back and we’d try and archive and install. Luckily the rep that responded when I called back didn’t put me through that and just put me through to order management for a replacement disc. After an hour on hold, it’s quickly sorted out and I’m told it’ll be shipped out in 2-3 days. 3 days later I discover it hasn’t been shipped, and is instead queued for a refund. Another half hour on the phone trying to explain I wanted a replacement because it was faulty, and it actually does get prepared for shipment, arriving the Monday after the first one arrived.

The install

So, armed with working disc, I pressed forward. The install proceeded as advertised – it said it would take about an hour, and it did – up until it got to the “Less than a minute” remaining, which took about… 45 minutes before I gave up. It was apparent it had frozen. No choice but to hard power down. Rebooted and it booted into the Snow Leopard welcome – the install was successful, but I was stuck in the first time set up. Everything I tried left the registration step getting to the end with all the buttons disabled… so, onto the phone with tech support. Started by rebooting in safe mode which took a really long time but didn’t help much. So we stepped through the process anyway. As it turns out…

To skip the registration process, you can use Cmd-Q and select skip.

Not very intuitive, but I guess it discourages skipping it rather than having the button right there in the dialog. So, now I can create an account (must be a new one), and I’m logged in. Everything is still there (*phew*). Reboot into normal mode (takes an eternity to shut down), log in as myself and remove the newly created account. An hour into the call, now I’m all set.

Incidently, during frequent periods of waiting for the Mac to boot / shutdown I discussed the virtues of a clean install with the tech support, but am told that wouldn’t be possible with the Snow Leopard upgrade disc (apparently in contradiction to what I was told by the very first tech support and most of what is said on the internet – curious).

I found I’d freed about 12Gb during the process (measured using df -k to avoid being duped by the redefinition of a Gb) – a handy saving.

Checking it out, I found I had a new /Recovered Items directory which was unusual. I’m not sure if I just got this because of the missed completion of the installer. About 500Mb of data, including some things that didn’t make it (like the XCode tools). I’m holding onto it for now, but it looks like I shouldn’t need it.

Next, to see what survived the upgrade.

The Victims

I was well aware of what might and might not work after the upgrade. Here’s what I’ve found so far:

  • XCode command line tools
  • Dovecot
  • MailTags (upgraded to their 10.6 special version which seems fine)
  • Mail Act-On (was using 1.3, may need to pay to upgrade to 2.0 now)
  • The sync server in Omnifocus
  • The Omnifocus mail integration (re-installed from OmniFocus preferences)
  • iStat Menus (upgraded to 2.0, no problems)
  • Java 1.3 / 1.4 / 5
  • Visor plugin (relies on SIMBL, not re-installing)
  • Sort ordering in smart mailboxes in is not retained (no fix found yet)
  • X-Lite had no sound (upgraded to a beta version that seems to work)

I uninstalled a few other things that I wasn’t using any more to try and get rid of 32-bit system preference panels (though most seemed to be working).

XCode Command Line Tools

Oddly, gcc-4.2 and the other command line tools were moved to Recovered Items but most of the XCode installation survived. I planned to reinstall the new version anyway, which I tried. This failed about halfway through without much information other than to try again, which I did and succeeded. Go figure.


I had recently moved from MacPorts to Homebrew in anticipation of the upgrade, and all continued working afterwards except for Dovecot.

First up, it seems the dovecot user had disappeared during the upgrade process. Luckily, 10.6 seems to have included one by default, _dovecot in the mail group. So I adjusted the Dovecot configuration.

Next, failure to read /private/etc/ssl/certs/dovecot.pem – had just forgotten to use sudo when running launchctl. Try again.

After that, there was a period where it wouldn’t start and gave no error in the system log. To be honest, I don’t know what I did to fix that but when I came back to it later after some reboots it was working again. Reassuring.

Eventually got it started again but failed to auth from The system log showed:

7/09/09 6:37:36 PM	dovecot-auth[82]	in openpam_load_module(): no found
7/09/09 6:37:36 PM	dovecot[80]	auth-worker(default): pam(brett, pam_start() failed: system error

Seems that this has been removed in Snow Leopard. I’d been using the /etc/pam.d/dovecot file given here. I used the further recommendation on the page to remove that file and change the dovecot configuration to this:

passdb pam {
  args = login

After all that, my local mail server is back.

OmniFocus sync server

This one was a little unusual. The sync server runs a copy of Apache HTTP Server, which was failing to start up. The logs revealed:

[Mon Sep 07 18:36:30 2009] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Sep 07 18:36:30 2009] [warn] RSA server certificate CommonName (CN) `mcbrett' does NOT match server name!?

While the short hostname of the machine was still mcbrett as before, it turned out that my installation pattern had changed the main host name to dummy's MacBook Pro 15" (dummy being the account name I created at first). I decided it was time for a change and changed my hostname to brettporter:

sudo hostname brettporter
sudo scutil --set HostName brettporter

Along with the same change in the Sharing system preferences, this was enough to get the sync server started again.

The Verdict

Other than these, my apps (including some that had received bad reports from others) seem to be working fine.

This was a much more painful upgrade than Leopard (salt in the wounds from the painful ordering process). The disk space saving is nice, but it never lasts 🙂 So far I haven’t noticed much in the way of performance improvements and have still obtained the marble of doom – time will tell if it seems to have improved or not. I’m particularly interested in Time Machine performance.

The big wins probably won’t come until applications start to take advantage of grand central and so on. All in all that is what appeals to me most about the release – most developers would love the opportunity to take some time and just clean things up in their projects and build out the core support.