Mail -> Thunderbird

  1. Address Book: File → Export vCard
  2. vCard → LDIF converter: download and run locally from the command line
  3. Thunderbird: Tools → Import... → Address Book → Text file
  1. Mail: Select all messages → File → Save as... → Raw Message Source format
  2. Thunderbird: Quit. Move the file exported from Mail to ~/Library/Thunderbird/Profiles/yourprofile.default/Mail/Local Folders/. Start Thunderbird.

Thunderbird FAQ

Thunderbird does sort threads properly, as long as you sort by Date and not Order Received.

Thunderbird's IMAP handling is much better than Mail 2's, and it also manages to do SSL over SSH without giving a random error.