Handling vcalendar entries in mutt
#375 Henry, Monday, 14 January 2019 11:32 AM (Category: Linux)
(Tags: mutt calendar)

I use mutt for mail, and it's a text based mailer, very fast, very neat, and I've been using it very happily for 20+ years. I ran into a small irritation last week.

We have new managers, so now I am getting vcalendar invitations to meetings. These are included in the email as mimetype text/calendar, and sometimes application/ics. Mostly the first one.

If I am just looking at the raw format of these invitations, I have a hard time understanding when these things start, especially factoring in timezones. So I went looking for a way to display the vcalendar info in mutt when viewing a message. There are some wonderful solutions out there, and I settled on this one.

Preliminary reading took me to this blog post about displaying text/calendar entries in mutt

The first step is to get a vcalendar filter, and there is a nice one available on github. Follow that link.

It requires a number of Perl modules:

Install those Perl modules, then put the script in your private bin directory and call it vcalendar-filter. Make sure it's executable. Test it by extracting a vcalendar entry from an email, saving it to a text file, and then running vcalendar-filter on it. If it works and displays a neat easily-understandable version of the meeting, you are ready to move on.

Edit your .mailcap file and add these lines:

text/calendar; /home/youruser/bin/vcalendar-filter %s; copiousoutput
application/ics; /home/youruser/bin/vcalendar-filter %s; copiousoutput

And finally, add this line to your .muttrc:

auto_view text/calendar application/ics

Now in mutt, when you get an email with a vcalendar entry, mutt will recognise it via the mime type, and do auto view, pulling how to autoview from the .mailcap file.

I didn't care for the emacs display in the final result, so I commented out the emacs section in the script vcalendar-filter. And now I can see these meeting invitations and not miss the meetings.

0 comments