Tuesday, September 12, 2006

GLib Universal Binary Framework

OK - so in the spirit of "If you can't find it, build it yourself", I finally got around to setting up a universal binary build of glib. It builds into a mac os framework.

Just download the file http://www.toonetown.com/projects/downloads/GLibFramework-2.12.3.zip, as well as version 2.12.3 of glib from gtk.org. Unzip the framework file and you will have a "macos" folder. Place that folder at the top level of the untarred glib sources and open up the file macos/GLibFramework/GLibFramework.xcodeproj in xcode and build!

This is the first step to my ultimate goal of getting WireShark to compile natively - as a universal binary. :)

Tuesday, September 05, 2006

Archiving AND compressing Mail.app messages

OK - so I was wanting to compress and archive my old messages - but I wanted to still have fairly easy access to them. I think I found a really nice way of doing this. I just put all the messages that I wanted to archive into their own folders (I did it by year - messages from 2000, 2001, etc). Then, for each folder I wanted to archive, I did the following:

  1. Open ~/Library/Mail/Mailboxes/[ARCHIVEFOLDER].mbox in BOTH finder and terminal

  2. In the Finder window, I copied the "Messages" folder to the desktop - and renamed it something a bit more descriptive (ie. "MailArchive-2000" or "MailArchive-2001")

  3. In the terminal window, I entered: ln -s /Volumes/[DESCRIPTIVENAME] Messages, ie. ln -s /Volumes/MailArchive-2000 Messages

  4. I opened DiskUtility, and created a New disk image from the folder on my desktop (File | New | Disk Image from Folder...). I made sure it was compressed.

Now, what this ended up doing was put all my messages in a compressed disk image on my hard drive. In Mail, the folder still shows up, and the message headers are all there cached - so I can even still search for messages based on "From", "To", or "Subject"... When I try to open a message in an archived folder, I get a message saying that I need to take the account online in order to read the message. When this happens, I simply double-click the corresponding image file, and it gets mounted, and I can access my messages easily.

Pretty Slick! If it weren't for Mail's smart way of handling offline folders, I think it would have been quite a bit harder. In addition, since I use compressed disk images, my old email messages end up taking up less than 50% of the original space on my disk....emails - being plain text - compress very nicely!

Maybe one day, if I'm REALLY ambitious, I'll write some kind of applescript that can do the whole thing for you....shouldn't be too hard. But I just don't have the time for it right now.

Converting kmail messages to Mac Mail.app messages

I wasn't able to find an easy way to convert Kmail messages to mac os Mail.app - without having to export to mbox format. For me, that wasn't an option.

I did, however, find a workaround.

  1. Create a new mailbox in mail.app (ie "Import"

  2. move your mail messages from kdemail/cur into ~/Library/Mail/Mailboxes/Import.mbox/Messages

  3. run the following: let num=9999; for i in `ls`; do cat $i | wc -c | sed -e 's/\t//g' | sed -e 's/ //g' > $num.emlx; cat $i >> $num.emlx; let num=$num+1; rm $i; done in a terminal window within the new "Messages" directory you have

  4. in Mail, choose to Rebuild the mailbox (Mailbox | Rebuild)

This seems to work because mail just stores its information in a modified maildir format (I'm guessing this only works for Tiger).