Exg2Cal first release (v0.0.1 alpha)

I have just recently created my first useful ruby app (it is a class really). We run Exchange at work, and I felt some concern that those who use FOSS apps to get mail and calendar info would be out of luck if they wanted to do calendaring (not a word) within our organization. Currently that is only me. So I installed Ruby (v1.8) and Mondrian and started looking at Net::IMAP to pull messages from calendar folders. Exchange uses the vCal/iCal format for events and they are either attached to a message, or the content of a message. It works. It is not refined, and I know it could use some error handling, threads, and maybe just a good look-over, but here it is:


It can be called like so:

require 'exg2cal'
#this is a range
#this is the name of the ical file. Right now '.ics' is auto-appended

What it does:

  1. Connects to an imap server of your choice
  2. Selects the imap folder of your choice
  3. Looks at the messages (usually all of them)
  4. If there are messages that are not flagged
  5. It grabs the calendar part and adds it to a ical file
  6. And then flags the message

Possible problems:

  • It does not check to make sure the content is a calendar! This means that you have to make sure that the folder you aim it at is a calendar folder. I will be looking at this part next.
  • It can be slow. I will also make it threaded so that it can make some connections concurrently.
  • It is my VERY FIRST program written in any language, and therefore may just be a mess. I am not even sure it qualifies as a program.
  • No documentation. No too much to document yet, I guess, but it is still a problem, especially if I ever turn it into a huge bloated tangle someday.
  • The file that is created/used is in the same folder as the app. I would like to be able to put it up on a WebDav server so that other calendar clients can subscribe, etc. I think that before that I will make it so that you can choose where to put the file.
  • No interface, not even cli, yet. I will look at making one, but I do not want to create too many dependencies. Maybe I will make a rails interface…

I use it to update my Sunbird calendar for our department. I use Thunderbird for email, so I miss out on the outlook features, but I can now access both the email and calendar info on any platform. Admittedly this is a little silly because we do have OWA running…

Published by


Hey, I run the place.

7 thoughts on “Exg2Cal first release (v0.0.1 alpha)”

  1. Either mod_rewrite is not working for you, or you don’t have it. You might want to turn off custom paths for now, as it renders this blog unnavigatable (if that even is a word).

  2. Yeah, no doubt. Thanks. I knew I should have tested it first. Actually, now that I think about it, I think I did test it a few months ago and found it would not work. I should take notes.

  3. Hey site admin…

    Maybe you should look at your settings. You do have mod_rewrite on but you used the prefix of /index.php/ even though you did not need to. Maybe you made the same mistake twice.

    Like a dog that returns to it’s vomit, so a fool returns to his folly.

  4. I find it amusing that this venture into programming makes it into your blog IN DETAIL, but your son’s broken arm doesn’t make the cut. Thankfully, your priorities appear differently off blog or I would be worried 😉

  5. Rock on! I’ve always been a bit dismayed at networked calendaring functionality in the Free world. I don’t use Exchange, but I would like some way to work with calendars the way imap lets you work with email.

    And Ruby is beautiful, as always.

  6. Very cool, daniel. An impressive first program. I have the same problem you do, but no solution at the moment. Are you going to release the source? What version of exchange is required?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.