This program converts Mac OS X Mail.app's proprietary mailstore to Maildir format.
osxmail2maildir takes one required argument and one optional one. The first argument (required) is the path into which osxmail2maildir should place all of the resulting Maildir directories. The second, optional argument is the location of the Mail.app mailstore. This is optional because it should be $HOME/Library/Mail which is where the script looks by default.
This script is written in Ruby. It requires Ruby 1.8.x. At the time of this writing, Ruby 1.8.2 is installed along with Mac OS X Tiger (10.4) by default.
The whole program is simply the lone script above. Download it, chmod +x it and then execute it (you'll probably only need it once).
Once the script is finished running, the target directory will contain one or more Maildir directories with the converted messages from the Mail.app mailstore. You can use any mail client capable of reading Maildir to view the messages. Alternatively, you can drop the resultant files from the Maildirs into existing Maildirs seamlessly; the script generates proper Maildir filenames and this should therefore not produce any collisions.