Subject: bug#30123: claws-mail plugins not updated

From: Danny Milosavljevic <[email-masked]>
Date: Mon, 15 Jan 2018 17:18:38 +0100

Hi Julien,

On Mon, 15 Jan 2018 14:52:30 +0100
julien lepiller <[email-masked]> wrote:

> claws-mail has a plugin system to add functionnality. For instance, to 
> add PGP support, one has to load 3 plugins from the claws-mail package. 
> By default, claws-mail looks in its store directory to propose available 
> plugins.
> 
> When upgrading claws-mail, the configuration doesn't change. Plugins are 
> still looked for in the old store location, so old plugins are still 
> used. This is bad for security and compatibility. Another issue is when 
> running guix gc afterwards: the old plugins are deleted and claws-mail 
> issues an error message on startup because it cannot find them anymore.

I wonder how that happened.

claws-mail already makes sure not to include the name of the plugin directory in entries in clawsrc:

static gchar * plugin_canonical_name(const Plugin *plugin)
{
        if (plugin->in_prefix_dir == TRUE) {
                if (plugin_filename_is_standard_dir(plugin->filename) == TRUE) {
                        gchar *plugin_name = g_path_get_basename(plugin->filename);
                        return plugin_name;
                }
        }
        return g_strdup(plugin->filename);
}

And after the update it SHOULD take the plugins from the new installation directory.

There's a Makefile variable PLUGINDIR which we could set, but as far as I can see it should already work fine (in claws-mail 3.16.0).

Do your ~/.claws-mail/clawsrc entries include the directory name?

If it's actually broken, the easiest fix would be to make get_plugin_dir() return the plugin directory in the profile instead.  If the user then configures the plugins, he'll (hopefully) take the ones from the profile directory (instead of the ones directly in the store).  The function above then stores only the basenames - and on a later update of claws-mail files with these basenames should be looked up in the new installation directory.  And even if the function should not work, claws-mail would take the plugins from the profile directory - which would be the new ones in the case of an update.

But I'd rather get to the bottom of this problem before making the claws-mail package so defensive.