astroid icon indicating copy to clipboard operation
astroid copied to clipboard

Support Outlook/Exchange calendar invites

Open mxmehl opened this issue 4 years ago • 4 comments

It's a plague: outlook calendar invites. These are mails to the attendees of an event that has been created in Outlook. The bad thing for astroid users is that there is no information about the details of the event in the text body, and the attachment (which is a base64 encoded ics file) has no name.

So in order to see the event's details, one has to save the attachment, give it a name (like event.ics) and import it in their calendar application. Optionally, one can inspect the ics file and see the date strings etc.

Such an email looks quite normal but has a multipart attachment:

--_000_58221f3d70604db9acca43f2129e12dbaiostaxde_
Content-Type: text/calendar; charset="utf-8"; method=REQUEST
Content-Transfer-Encoding: base64

QkVHSU46VkNBTEVOREFSDQpNRVRIT0Q6UkVRVUVTVA0KUFJPRElEOk1pY3Jvc29mdCBFeGNoYW5n
ZSBTZXJ2ZXIgMjAxMA0KVkVSU0lPTjoyLjANCkJFR0lOOlZUSU1FWk9ORQ0KVFpJRDpXLiBFdXJv
[...]

I am not sure how astroid could support its users here. Perhaps give such attachments an automatic name like "event.ics", or even display the information inline, at least title, description and date? Anything would be better than the current (non-existant) flow.

mxmehl avatar Jul 07 '20 10:07 mxmehl

Is this different from what gmail does? From gmail I get "Unnamed attachment", but they seem to be detected by xdg-open. With https://github.com/astroidmail/astroid/issues/339 (https://github.com/astroidmail/astroid/wiki/Opening-attachments-and-virus-detection) they open as expected.

mreppen avatar Jul 08 '20 14:07 mreppen

Hey there, I was trying to create a plugin for that, inspired by the https://github.com/astroidmail/astroid-syntax-highlight maybe using the https://github.com/collective/icalendar package. But seems that from the plugin interface that the source of the message (and so attachments) are not available to be processed https://github.com/astroidmail/astroid/blob/master/src/plugin/thread_view_activatable.c#L178 . Am I missing something?

puria avatar Aug 06 '20 07:08 puria

Puria Nafisi Azizi writes on August 6, 2020 9:40:

Hey there, I was trying to create a plugin for that, inspired by the https://github.com/astroidmail/astroid-syntax-highlight maybe using the https://github.com/collective/icalendar package. But seems that from the plugin interface that the source of the message (and so attachments) are not available to be processed https://github.com/astroidmail/astroid/blob/master/src/plugin/thread_view_activatable.c#L178 . Am I missing something?

If you have the message id and file name you can open the message directly from file using pythons email library.

gauteh avatar Aug 06 '20 08:08 gauteh

That make sense, but you have any idea of how? In do_filter_part and in do_get_avatar_uri I don't see any mid nor filename, obviously I'm looking at the https://github.com/astroidmail/astroid/wiki/Plugins#threadviewactivatable as like in the https://github.com/astroidmail/astroid-plugins/blob/master/official-examples/ThreadViewExamplePlugin/threadview.py but maybe is the wrong place ;p

puria avatar Aug 09 '20 10:08 puria