Due to Thunderbird repeatedly crashing on my in openSUSE 10.2 I am now using Kontact/Kmail. Aside from a few config issues Kmail is great, and I am really loving the simple interface. I wanted to incorporate the calendar however, and also have the ability to email reminders of upcoming events. Kontact has a great calendar associated with it, as well as a To-Do list with the ability to configure simple and advanced reminders.

The ability to email the reminders is not available though, and in my searches through Google it seems that this is a feature many people would like to see. While you can’t email directly from Kontact you can run a program at a specific time (shades of Cron!), and this is where I was able to fudge something together with mutt.
Mutt is a wonderful mail client on it’s own, but in these days of gooey guis, I tend to stick with a nice interface program for most applications. I do use mutt exclusively though for any command line and system mailings I need to do. I create satellite images daily through cron and mail them to myself to make sure that the data was processed correctly. For these tasks mutt can’t be beat! For me mutt was already installed in /usr/bin but if you don’t have it you can grab it through either a package manager or build it from source (Get Mutt Here!)

Now this fix does NOT mail out the exact description of your event, just that you have an event coming up and that you should check your calendar. At this point it seems that while you can call a program through Kontact you cannot pass any arguments either, so I’m not quite sure yet how to get the info out. Honestly I haven’t spent a lot of time working on it yet, but this was good enough for me, and I wanted to post it lest I forgot what I did later!

#!/bin/bash
# This is a simple reminder program to tell you to check Kontact!
# Variables:
# subject – What you want the subject line to be (e.g. Check Kontact!)
# text – What you want to send in the body of the message
# email – The email address to send the message to, this can be multiple
# addresses separated by commas (me@me.com, me2@me.com)
subject=”What you want the subject to be…”>
text=”This will be the body of the message, change to what you want to say!”
email=”yourname@yourhost.com”
echo $text > temp.txt # make a tempfile with the text in it
/usr/bin/mutt -s”$subject” $email < temp.txt # email the file
rm temp.txt # remove the file

That should do it! More to come if I can get increased functionality out of this.

Advertisements