khal icon indicating copy to clipboard operation
khal copied to clipboard

View and Respond to .ics attachments (RFC 5546 support)

Open prologic opened this issue 9 years ago • 19 comments

This might seem out of scope for khal but hopefully not.

This is the use-case:

  • Open email with invitation in mutt
  • View attachments
  • khal display the invitation and it's details
  • khal prompts the user for accept/reject or do nothing

There are several (only two actually that I've found) such tools that integrate (somewhat) with mutt that let one view and/or (maybe) respond to invitations.

Thoughts?

prologic avatar Nov 27 '14 20:11 prologic

How do responses to invitations look like?

untitaker avatar Nov 27 '14 21:11 untitaker

They're basically emailed modified ics attachments.

See: https://github.com/marvinthepa/mutt-ical

prologic avatar Nov 27 '14 21:11 prologic

I do have this feature on the todo list, but it's not exactly high priority. This is actually specified in RFC 5546

geier avatar Nov 28 '14 13:11 geier

I think @jasonwryan did something with iCalendar invites.

untitaker avatar Nov 28 '14 16:11 untitaker

Yes, a little perl and awk hacked together: http://jasonwryan.com/blog/2014/04/05/calendar/

jasonwryan avatar Nov 28 '14 18:11 jasonwryan

Yeah I've seen two hacked up examples both of which work more or less :)

I'd just like to see this polished up and included in something like khal :)

I'll see if I can put together a PR

prologic avatar Nov 28 '14 21:11 prologic

@prologic Did you come up with something?

flokli avatar Dec 05 '17 22:12 flokli

I'm sorry I did not.

James Mills / prologic

E: [email protected] W: prologic.shortcircuit.net.au

On Tue, Dec 5, 2017 at 2:44 PM, Florian Klink [email protected] wrote:

@prologic https://github.com/prologic Did you come up with something?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pimutils/khal/issues/132#issuecomment-349466595, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-mAz0GsXKHfJpijk2AuDBopomGBmks5s9cc_gaJpZM4DBjv- .

prologic avatar Dec 05 '17 23:12 prologic

@prologic No problem, just hoped to go the easy path :-D

I already use khal printics to show invitations in mutt. Let's see it I find the time to add code to khal to display more ;-)

flokli avatar Dec 11 '17 15:12 flokli

@flokli Can you explain how you use khal printics for this ? Any solution for this problem in general ?

bepolymathe avatar Jan 28 '19 12:01 bepolymathe

@bepolymathe my mailcap file has the following line:

text/calendar; khal printics %s;copiousoutput

flokli avatar Mar 03 '19 19:03 flokli

Thank you for your answer. This allows you to view the content of the.ics file but not to transfer it to Khal. "khal import" gives me a mistake. Can anyone import events into khal?

bepolymathe avatar Mar 04 '19 09:03 bepolymathe

So far, I only used it to display ics attachments, not import - which is a bit of a mess on its own, as khal printics refuses to run if you have no calendars configured (that you don't need for reading ics), as that's an assertion done when reading settings, not when interacting with calendars…

flokli avatar Mar 04 '19 12:03 flokli

They're basically emailed modified ics attachments.

See: https://github.com/marvinthepa/mutt-ical

I don't see why something like this script couldn't be rather easily incorporated into Khal. It is already in Python and gives a way to respond to invites (which it does not seem that Khal has at the moment or else this would be a closed issue). At the very least, it seems that the mailcap entry suggested above could be modified to be something like:

text/calendar; khal printics %s;copiousoutput
application/ics; <path>mutt-ical.py -i -e "[email protected]" %s; needsterminal

Then one would always see when an invite is attached and have the option to respond to it. To make it easy to do so, one could define a macro that selects the proper part of the multipart message which will activate the mailcap entry.

guyest avatar Jun 13 '19 17:06 guyest

For me, it doesn't work. Would it be possible to consider an order that would do:

save the.ics file temporarily + khal import + delete the file

What do you think of that?

bepolymathe avatar Jun 14 '19 07:06 bepolymathe

Hi, I had quite some problems dealing with mutt2khal and the other perl script (sorry, I'm 100% perl ignorant) and I've built https://github.com/nofeed/vkhal mostly to have fun but as of now it works pretty well for me. I'm available to expand and refactor, in case open an issue with something I can reproduce, I'll be happy to help.

ngw avatar Aug 20 '19 13:08 ngw

I have tried the mutt-ical script above and another one. Both produced email responses that neither Outlook nor Google would recognise as replies to the invite.

With some minor adaptation i made the latter work. From my experiments it seems that you just need to build the right ICS file which you then attach to an email to the event organiser. Depending on scope, Khal could either just produce the ICS, or deal with sending the email.

My working script is here for reference. I don't have much time to look into coding it into Khal, but i might do something over Christmas.

yourealwaysbe avatar Oct 16 '19 09:10 yourealwaysbe

Had a good laugh stumbling upon this thread dating back to... 2014, and which has been necrobumped several times now. My turn! Soon 10 years and we haven't come up with a proper solution within khal itself.

I think khal itself should be configurable to send the email (assuming the existence of an already-configured MUA (Mail User Agent, e.g. msmtp, Thunderbird) that is capable of sending an email from the command line), produce the ICS file, and execute the command in a subprocess.

What do you guys think? Maybe I can work something out in a PR (and hopefully not come back in 2 years when someone else necrobumps this thread, saying I switched back to Thunderbird)

tgy avatar Jun 25 '23 23:06 tgy

@tgy I'd love to see something like this. Have at it.

In #1271 I added a new address parameter for each calendar, which somewhat goes into this direction (but there was already an objection, that it might be more useful to have a list of addresses), perhaps you can add to that discussion if you are thinking about this.

geier avatar Jun 26 '23 07:06 geier