Re: [Evolution-hackers] Adjusting email for display



On Thu, 2022-06-16 at 04:13 +0200, Ángel wrote:
Apparently this would mean changing the email contents before they
are passed to WebkitGtk for display (alternatively, they could be
changed when fetched from the mail store).

        Hi,
why in the mail store? That means you cannot restore the message to its
original form, which is kinda bad, is it not? Nonetheless, the mail
providers are not extensible, thus you cannot get to the internal
interpretation of the email and modify it in their store/cache.

but not the place where it defines the "mail://" protocol so that
webkit may us such URI to fech a html document.

It's defined here:
https://gitlab.gnome.org/GNOME/evolution/-/blob/master/src/mail/e-mail-request.c

but all the work is done here:
https://gitlab.gnome.org/GNOME/evolution/-/tree/master/src/em-format

split into parser, which "filters" which parts should be shown, and
then into formatter, which converts the selected parts' content into
HTML, which is passed into the WebKitGTK. You can write your own
extension and override default handling for either of the content
types.

When you run Evolution from a terminal as:

   $ CAMEL_DEBUG=emformat evolution

You'll see some information, which may or may not be useful for you.

An example is here:
https://gitlab.gnome.org/GNOME/evolution-rss/-/blob/master/src/e-mail-formatter-evolution-rss.c
https://gitlab.gnome.org/GNOME/evolution-rss/-/blob/master/src/e-mail-parser-evolution-rss.c
even it defines its own part with its own Content-Type:
https://gitlab.gnome.org/GNOME/evolution-rss/-/blob/master/src/e-mail-part-rss.c
thus it's not the same thing as you want.

The extensions are described in a bit more detail here:
https://wiki.gnome.org/Apps/Evolution/Extensions
with an example module, which does something else, but it can be used
as a starting point.

If you want to cover only message preview, then maybe a bit easier
would be to use the preview plugin:
https://wiki.gnome.org/Apps/Evolution/Extensions#Preview_and_WebKit_Editor_plugins
This won't cover reply/forward of the message, for those you'd need
also an editor plugin and even that won't help if the user forwards as
attachment.

The forward as attachment won't cover the em-format either, but it
covers the reply/forward "inline".
        Bye,
        Milan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]