< Hacktavism & The 5th Estate | Squinting at Security Drivers & Perspective-based Biases >
I moved back to the world of civilized e-mail, i.e. mutt. It's been wonderful, and I particularly enjoy hacking my mailcap to display things just how I like them (no PDF sploits for me). However, OSX's handling of calendar files is very irritating in that iCal tries to send responses via Mail.app without giving you much of a chance to do anything. I'd rather handle it in mutt and the cli. This is also generally useful for people using mutt who want to handle calendar files.
I found a script mutt-ical, which does most of what I wanted; parse the ics, ask me what I want to do, then mail the organiser with my response. I made some changes to make it support Outlook generated calendar files, not override your mutt "send" settings, and display the calendar details in plaintext before you decide to accept/decline/tentative it.
- Download my version here. (
I'd submit a patch, but the developer has no working contact detailsI worked out how git pull request work :) )
- Copy it into somewhere in your PATH, (or you can specify the PATH in your .mailcap)
- Edit your mailcap to have the following line:
- text/calendar; <path>mutt-ical.py -i -e "firstname.lastname@example.org" %s
- For added fun on OSX, you can extend it to the following, to get iCal to open it nicely too (iCal cares not for mime types it seems):
- text/calendar; open %s && ~/bin/mutt-ical.py -i -e "email@example.com" %s; nametemplate=%s.ics
text/calendar; mv %s %s.ics && open %s.ics && <path>mutt-ical.py -i -e "firstname.lastname@example.org" %s.ics && rm %s.ics(I found nametemplate fixes this problem)
- You can force iCal to stop trying to send mail on your behalf by replacing the file /Applications/iCal.app/Contents/Resources/Scripts/Mail.scpt with your own ActionScript. I went with the following: error number -128 Which tells it that the user cancelled the action.
- Open AppleScript Editor, paste the code from above into a new script, then save it.
- Move the old script /Applications/iCal.app/Contents/Resources/Scripts/Mail.scpt just in case you want to re-enable the functionality.
- Copy your new script into place.