2012-05-27 [paul] 3.8.0cvs48
[claws.git] / src / common / plugin.c
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20
21 #ifdef HAVE_CONFIG_H
22 #  include "config.h"
23 #endif
24
25 #include <stdio.h>
26 #ifdef HAVE_VALGRIND
27 #include <valgrind.h>
28 #endif
29
30 #include "defs.h"
31 #include <glib.h>
32 #ifdef ENABLE_NLS
33 #include <glib/gi18n.h>
34 #else
35 #define _(a) (a)
36 #define N_(a) (a)
37 #endif
38 #include <gmodule.h>
39
40 #include "utils.h"
41 #include "plugin.h"
42 #include "prefs.h"
43 #include "claws.h"
44 #include "timing.h"
45
46 struct _Plugin
47 {
48         gchar   *filename;
49         GModule *module;
50         const gchar *(*name) (void);
51         const gchar *(*desc) (void);
52         const gchar *(*version) (void);
53         const gchar *(*type) (void);
54         const gchar *(*licence) (void);
55         struct PluginFeature *(*provides) (void);
56         
57         GSList *rdeps;
58         gchar *error;
59         gboolean unloaded_hidden;
60 };
61
62 const gchar *plugin_feature_names[] =
63         { N_("Nothing"),
64           N_("a viewer"),
65           N_("a MIME parser"),
66           N_("folders"),
67           N_("filtering"),
68           N_("a privacy interface"),
69           N_("a notifier"),
70           N_("an utility"),
71           N_("things"),
72           NULL };
73
74 /* The plugin must be at least under one of these licences and have
75    the corresponding token returned by the plugin_licence function.
76  */
77 const gchar const *plugin_licence_tokens[] = {
78   "LGPL2.1+", "LGPLv2.1+", "LGPL2.1", "LGPLv2.1",
79   "LGPL3+", "LGPLv3+", "LGPL3", "LGPLv3",
80   "GPL3+", "GPLv3+", "GPL3", "GPLv3",
81   "GPL2+", "GPLv2+",
82   "Apache2.0", "Apache 2.0", "Apache v2.0",
83   "2-clause BSD", "Simplified BSD", "FreeBSD",
84   "3-clause BSD", "New BSD", "Modified BSD",
85   NULL
86 };
87
88 /* Dual (or more) licences are allowed, must be separated by one of these.
89  */
90 #define IS_LICENCE_SEP(a) ((a) == ',' || (a) == ';' || (a) == '|' || (a) == '/' || (a) == '\0')
91
92 /**
93  * List of all loaded plugins
94  */
95 GSList *plugins = NULL;
96 GSList *plugin_types = NULL;
97
98 /* 
99  * List of plugins unloaded for some fixable reason
100  */
101 static GSList *unloaded_plugins = NULL;
102
103 static gint list_find_by_string(gconstpointer data, gconstpointer str)
104 {
105         return strcmp((gchar *)data, (gchar *)str) ? TRUE : FALSE;
106 }
107
108 static gint list_find_by_plugin_filename(const Plugin *plugin, const gchar *filename)
109 {
110         /* FIXME: There is a problem in case of symlinks or when a
111            user tries to load a plugin with the same name from a
112            different directory.  I think it would be better to compare
113            only the basename of the filename here (case-insensitive on
114            W32). */
115         cm_return_val_if_fail(plugin, 1);
116         cm_return_val_if_fail(plugin->filename, 1);
117         cm_return_val_if_fail(filename, 1);
118         return strcmp(filename, plugin->filename);
119 }
120
121 void plugin_save_list(void)
122 {
123         gchar *rcpath, *block;
124         PrefFile *pfile;
125         GSList *type_cur, *plugin_cur;
126         Plugin *plugin;
127         
128         for (type_cur = plugin_types; type_cur != NULL; type_cur = g_slist_next(type_cur)) {
129                 rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
130 #ifdef G_OS_WIN32
131                 block = g_strconcat("PluginsWin32_", type_cur->data, NULL);
132 #else
133                 block = g_strconcat("Plugins_", type_cur->data, NULL);
134 #endif
135                 if ((pfile = prefs_write_open(rcpath)) == NULL ||
136                     (prefs_set_block_label(pfile, block) < 0)) {
137                         g_warning("failed to write plugin list\n");
138                         g_free(rcpath);
139                         return;
140                 }
141                 g_free(block);
142
143                 for (plugin_cur = plugins; plugin_cur != NULL; plugin_cur = g_slist_next(plugin_cur)) {
144                         plugin = (Plugin *) plugin_cur->data;
145                         
146                         if (plugin->unloaded_hidden)
147                                 continue;
148
149                         if (!strcmp(plugin->type(), type_cur->data))
150                                 if (fprintf(pfile->fp, "%s\n", plugin->filename) < 0)
151                                         goto revert;
152                 }
153                 for (plugin_cur = unloaded_plugins; plugin_cur != NULL; plugin_cur = g_slist_next(plugin_cur)) {
154                         plugin = (Plugin *) plugin_cur->data;
155
156                         if (plugin->unloaded_hidden)
157                                 continue;
158                         
159                         if (!strcmp(plugin->type(), type_cur->data))
160                                 if (fprintf(pfile->fp, "%s\n", plugin->filename) < 0)
161                                         goto revert;
162                 }
163                 if (fprintf(pfile->fp, "\n") < 0)
164                         goto revert;
165
166                 if (prefs_file_close(pfile) < 0)
167                         g_warning("failed to write plugin list\n");
168
169                 g_free(rcpath); 
170                 
171                 continue;
172
173 revert:
174                 g_warning("failed to write plugin list\n");
175                 if (prefs_file_close_revert(pfile) < 0)
176                         g_warning("failed to revert plugin list\n");
177
178                 g_free(rcpath); 
179         }
180 }
181
182 static gboolean plugin_is_loaded(const gchar *filename)
183 {
184         return (g_slist_find_custom(plugins, filename, 
185                   (GCompareFunc)list_find_by_plugin_filename) != NULL);
186 }
187
188 static Plugin *plugin_get_by_filename(const gchar *filename)
189 {
190         GSList *cur = plugins;
191         for(; cur; cur = cur->next) {
192                 Plugin *p = (Plugin *)cur->data;
193                 if (!strcmp(p->filename, filename)) {
194                         return p;
195                 } 
196         }
197         return NULL;
198 }
199
200 /** 
201  * Loads a plugin dependancies
202  * 
203  * Plugin dependancies are, optionnaly, listed in a file in
204  * get_plugin_dir()/$pluginname.deps.
205  * \param filename The filename of the plugin for which we have to load deps
206  * \param error The location where an error string can be stored
207  * \return 0 on success, -1 otherwise
208  */
209 static gint plugin_load_deps(const gchar *filename, gchar **error)
210 {
211         gchar *tmp;
212         gchar *deps_file = NULL;
213         FILE *fp = NULL;
214         gchar buf[BUFFSIZE];
215         gchar *p;
216
217         tmp = g_strdup(filename);
218         if( (p = strrchr(tmp, '.')) )
219           *p = '\0';
220         deps_file = g_strconcat(tmp, ".deps", NULL);
221         g_free(tmp);
222         
223         fp = g_fopen(deps_file, "rb");
224         g_free(deps_file);
225         
226         if (!fp)
227                 return 0;
228         
229         while (fgets(buf, sizeof(buf), fp) != NULL) {
230                 Plugin *dep_plugin = NULL;
231                 gchar *path = NULL;
232                 buf[strlen(buf)-1]='\0'; /* chop off \n */
233                 path = g_strconcat(get_plugin_dir(), buf,
234                                 ".", G_MODULE_SUFFIX, NULL);
235                 if ((dep_plugin = plugin_get_by_filename(path)) == NULL) {
236                         debug_print("trying to load %s\n", path);
237                         dep_plugin = plugin_load(path, error);
238                         if (dep_plugin == NULL) {
239                                 g_free(path);
240                                 fclose(fp);
241                                 return -1;
242                         }
243                 }
244                 g_free(path);
245                 if (!g_slist_find_custom(dep_plugin->rdeps, 
246                                 (gpointer) filename, list_find_by_string)) {
247                         debug_print("adding %s to %s rdeps\n",
248                                 filename,
249                                 dep_plugin->filename);
250                         dep_plugin->rdeps = 
251                                 g_slist_append(dep_plugin->rdeps, 
252                                         g_strdup(filename));
253                 }
254         }
255         fclose(fp);
256         return 0;
257 }
258
259 static void plugin_unload_rdeps(Plugin *plugin)
260 {
261         GSList *cur = plugin->rdeps;
262         debug_print("removing %s rdeps\n", plugin->filename);
263         while (cur) {
264                 gchar *file = (gchar *)cur->data;
265                 Plugin *rdep_plugin = file?plugin_get_by_filename(file):NULL;
266                 debug_print(" rdep %s: %p\n", file, rdep_plugin);
267                 if (rdep_plugin) {
268                         plugin_unload(rdep_plugin);
269                 }
270                 g_free(file);
271                 cur = cur->next;
272         }
273         g_slist_free(plugin->rdeps);
274         plugin->rdeps = NULL;
275 }
276
277 static void plugin_remove_from_unloaded_list (const gchar *filename)
278 {
279         GSList *item = g_slist_find_custom(unloaded_plugins, 
280                                 (gpointer) filename, (GCompareFunc)list_find_by_plugin_filename);
281         Plugin *unloaded_plugin = item ? ((Plugin *)item->data):NULL;
282         if (unloaded_plugin != NULL) {
283                 debug_print("removing %s from unloaded list\n", unloaded_plugin->filename);
284                 unloaded_plugins = g_slist_remove(unloaded_plugins, unloaded_plugin);
285                 g_module_close(unloaded_plugin->module);
286                 g_free(unloaded_plugin->filename);
287                 g_free(unloaded_plugin->error);
288                 g_free(unloaded_plugin);
289         }
290 }
291
292 static gchar *plugin_check_features(struct PluginFeature *features) {
293         int i = 0, j = 0;
294         GSList *cur = plugins;
295
296         if (features == NULL)
297                 return NULL;
298         for(; cur; cur = cur->next) {
299                 Plugin *p = (Plugin *)cur->data;
300                 struct PluginFeature *cur_features = p->provides();
301                 if (p->unloaded_hidden)
302                         continue;
303                 for (j = 0; cur_features[j].type != PLUGIN_NOTHING; j++) {
304                         for (i = 0; features[i].type != PLUGIN_NOTHING; i++) {
305                                 if (cur_features[j].type == features[i].type &&
306                                     !strcmp(cur_features[j].subtype, features[i].subtype)) {
307                                         return g_strdup_printf(_(
308                                                 "This plugin provides %s (%s), which is "
309                                                 "already provided by the %s plugin."),
310                                                 _(plugin_feature_names[features[i].type]), 
311                                                 _(features[i].subtype),
312                                                 p->name());
313                                 }
314                         }
315                 }
316         }
317
318         return NULL;
319 }
320
321 static gboolean plugin_licence_check(const gchar *licence) {
322         gint i = 0;
323         gint len = 0;
324         
325         if (licence != NULL) {
326                 len = strlen(licence);
327         }
328         if (len == 0) {
329                 g_warning("plugin licence check failed: empty licence\n");
330                 return FALSE;
331         }
332         while (plugin_licence_tokens[i] != NULL) {
333                 gchar *found = g_strstr_len(licence, len, plugin_licence_tokens[i]);
334                 if (found != NULL) {
335                         gint tlen = strlen(plugin_licence_tokens[i]);
336                         if (len != tlen) { /* not a single license */
337                                 if (((found == licence) &&  (!IS_LICENCE_SEP(licence[tlen])))
338                                                 || (!IS_LICENCE_SEP(*(found - 1))) 
339                                                 || (!IS_LICENCE_SEP(*(found + tlen)))) {
340                                         debug_print("plugin licence check failed: invalid separator\n");
341                                         return FALSE;
342                                 }
343                         }
344                         debug_print("plugin licence check passed: %s found\n", plugin_licence_tokens[i]);
345                         return TRUE;
346                 }
347                 ++i;
348         }
349         debug_print("plugin licence check failed: %s is not a valid licence\n", licence);
350         return FALSE;
351 }
352
353 /**
354  * Loads a plugin
355  *
356  * \param filename The filename of the plugin to load
357  * \param error The location where an error string can be stored
358  * \return the plugin on success, NULL otherwise
359  */
360 Plugin *plugin_load(const gchar *filename, gchar **error)
361 {
362         Plugin *plugin;
363         gint (*plugin_init) (gchar **error);
364         gpointer plugin_name, plugin_desc, plugin_version;
365         const gchar *(*plugin_type)(void);
366         const gchar *(*plugin_licence)(void);
367         struct PluginFeature *(*plugin_provides)(void);
368         gint ok;
369         START_TIMING((filename?filename:"NULL plugin"));
370         cm_return_val_if_fail(filename != NULL, NULL);
371         cm_return_val_if_fail(error != NULL, NULL);
372
373         /* check duplicate plugin path name */
374         if (plugin_is_loaded(filename)) {
375                 plugin = plugin_get_by_filename(filename);
376                 if (plugin->unloaded_hidden) {
377                         /* reshow it */
378                         goto init_plugin;
379                 } else {
380                         *error = g_strdup(_("Plugin already loaded"));
381                         return NULL;            
382                 }
383         }                              
384         
385         plugin_remove_from_unloaded_list(filename);
386         
387         if (plugin_load_deps(filename, error) < 0)
388                 return NULL;
389         plugin = g_new0(Plugin, 1);
390         if (plugin == NULL) {
391                 *error = g_strdup(_("Failed to allocate memory for Plugin"));
392                 return NULL;
393         }
394
395         debug_print("trying to load `%s'\n", filename);
396         plugin->module = g_module_open(filename, 0);
397         if (plugin->module == NULL) {
398                 *error = g_strdup(g_module_error());
399                 g_free(plugin);
400                 return NULL;
401         }
402
403 init_plugin:
404         if (!g_module_symbol(plugin->module, "plugin_name", &plugin_name) ||
405             !g_module_symbol(plugin->module, "plugin_desc", &plugin_desc) ||
406             !g_module_symbol(plugin->module, "plugin_version", &plugin_version) ||
407             !g_module_symbol(plugin->module, "plugin_type", (gpointer)&plugin_type) ||
408             !g_module_symbol(plugin->module, "plugin_licence", (gpointer)&plugin_licence) ||
409             !g_module_symbol(plugin->module, "plugin_provides", (gpointer)&plugin_provides) ||
410             !g_module_symbol(plugin->module, "plugin_init", (gpointer)&plugin_init)) {
411                 *error = g_strdup(g_module_error());
412                 if (plugin->unloaded_hidden)
413                         return NULL;
414                 g_module_close(plugin->module);
415                 g_free(plugin);
416                 return NULL;
417         }
418         
419         if (plugin_licence_check(plugin_licence()) != TRUE) {
420                 *error = g_strdup(_("This module is not licensed under a GPL v3 or later compatible license."));
421                 if (plugin->unloaded_hidden)
422                         return NULL;
423                 g_module_close(plugin->module);
424                 g_free(plugin);
425                 return NULL;
426         }
427
428         if (!strcmp(plugin_type(), "GTK")) {
429                 *error = g_strdup(_("This module is for Claws Mail GTK1."));
430                 if (plugin->unloaded_hidden)
431                         return NULL;
432                 g_module_close(plugin->module);
433                 g_free(plugin);
434                 return NULL;
435         }
436
437         if ((*error = plugin_check_features(plugin_provides())) != NULL) {
438                 if (plugin->unloaded_hidden)
439                         return NULL;
440                 g_module_close(plugin->module);
441                 g_free(plugin);
442                 return NULL;
443         }
444         plugin->name = plugin_name;
445         plugin->desc = plugin_desc;
446         plugin->version = plugin_version;
447         plugin->type = plugin_type;
448         plugin->licence = plugin_licence;
449         plugin->provides = plugin_provides;
450         plugin->filename = g_strdup(filename);
451         plugin->error = NULL;
452
453         if ((ok = plugin_init(error)) < 0) {
454                 if (*error)
455                         plugin->error = g_strdup(*error);
456                 unloaded_plugins = g_slist_append(unloaded_plugins, plugin);
457                 return NULL;
458         }
459
460         if (!plugin->unloaded_hidden)
461                 plugins = g_slist_append(plugins, plugin);
462         plugin->unloaded_hidden = FALSE;
463
464         debug_print("Plugin %s (from file %s) loaded\n", plugin->name(), filename);
465         END_TIMING();
466         return plugin;
467 }
468
469 void plugin_unload(Plugin *plugin)
470 {
471         gboolean (*plugin_done) (void);
472         gboolean can_unload = TRUE;
473
474         plugin_unload_rdeps(plugin);
475
476         if (plugin->unloaded_hidden)
477                 return;
478
479         if (plugin->error) {
480                 plugin_remove_from_unloaded_list(plugin->filename);
481                 return;
482         }
483         if (g_module_symbol(plugin->module, "plugin_done", (gpointer) &plugin_done)) {
484                 can_unload = plugin_done();
485         }
486
487         if (can_unload) {
488 #ifdef HAVE_VALGRIND
489                 if (!RUNNING_ON_VALGRIND) {
490                         g_module_close(plugin->module);
491                 }
492 #else
493                 g_module_close(plugin->module);
494 #endif
495                 plugins = g_slist_remove(plugins, plugin);
496                 g_free(plugin->filename);
497                 g_free(plugin);
498         } else {
499                 plugin->unloaded_hidden = TRUE;
500         }
501
502 }
503
504 void plugin_load_all(const gchar *type)
505 {
506         gchar *rcpath;
507         gchar buf[BUFFSIZE];
508         PrefFile *pfile;
509         gchar *error = NULL, *block;
510
511         plugin_types = g_slist_append(plugin_types, g_strdup(type));
512
513         rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL); 
514 #ifdef G_OS_WIN32
515         block = g_strconcat("PluginsWin32_", type, NULL);
516 #else
517         block = g_strconcat("Plugins_", type, NULL);
518 #endif
519         if ((pfile = prefs_read_open(rcpath)) == NULL ||
520             (prefs_set_block_label(pfile, block) < 0)) {
521                 g_free(rcpath);
522                 if (pfile)
523                         prefs_file_close(pfile);
524                 return;
525         }
526         g_free(block);
527
528         while (fgets(buf, sizeof(buf), pfile->fp) != NULL) {
529                 if (buf[0] == '[')
530                         break;
531
532                 g_strstrip(buf);
533                 if ((buf[0] != '\0') && (plugin_load(buf, &error) == NULL)) {
534                         g_warning("plugin loading error: %s\n", error);
535                         g_free(error);
536                 }                                                       
537         }
538         prefs_file_close(pfile);
539
540         g_free(rcpath);
541 }
542
543 void plugin_unload_all(const gchar *type)
544 {
545         GSList *list, *cur;
546
547         list = g_slist_copy(plugins);
548         list = g_slist_reverse(list);
549
550         for(cur = list; cur != NULL; cur = g_slist_next(cur)) {
551                 Plugin *plugin = (Plugin *) cur->data;
552                 
553                 if (!strcmp(type, plugin->type()))
554                         plugin_unload(plugin);
555         }
556         g_slist_free(list);
557
558         cur = g_slist_find_custom(plugin_types, (gpointer) type, list_find_by_string);
559         if (cur) {
560                 g_free(cur->data);
561                 plugin_types = g_slist_remove(plugin_types, cur);
562         }
563 }
564
565
566 /* Load those plugins we always want to use.  No error output; just
567  * try. */
568 void plugin_load_standard_plugins (void)
569 {
570         static const char *names[] = {
571 #ifdef G_OS_WIN32 
572                 "pgpmime",
573                 "pgpinline",
574 #else
575                 /* post-2.5 maybe 
576                 "bogofilter", */
577 #endif
578                 NULL
579         };
580         int i;
581         gchar *error, *filename;
582         
583         for (i=0; names[i]; i++) {
584                 /* Simple hack to check whether the plugin has already
585                  * been loaded but checking only for the basename. */
586                 GSList *cur = plugins;
587                 for(; cur; cur = cur->next) {
588                         Plugin *p = (Plugin *)cur->data;
589                         if (strstr(p->filename, names[i]))
590                                 break;
591                 }
592                 if (!cur) { /* Not yet loaded. */
593                         /* FIXME: get_plugin_dir () returns with a trailing
594                          * (back)slash; this should be fixed so that we can use
595                          * g_module_build_path here. */
596 #ifdef G_OS_WIN32 
597                         filename = g_strconcat (get_plugin_dir(),
598                                                 names[i], NULL);
599 #else
600                         filename = g_strconcat (get_plugin_dir(),
601                                                 names[i], ".", G_MODULE_SUFFIX, NULL);
602 #endif
603                         error = NULL;
604                         plugin_load(filename, &error);
605                         g_free (error);
606                         g_free(filename);
607                 }
608         }
609 }
610
611 GSList *plugin_get_list(void)
612 {
613         GSList *new = NULL;
614         GSList *cur = plugins;
615         for (; cur; cur = cur->next) {
616                 Plugin *p = (Plugin *)cur->data;
617                 if (!p->unloaded_hidden)
618                         new = g_slist_prepend(new, p);
619         }
620         new = g_slist_reverse(new);
621         return new;
622 }
623
624 Plugin *plugin_get_loaded_by_name(const gchar *name) 
625 {
626         Plugin *plugin = NULL;
627         GSList *new, *cur; 
628         new = plugin_get_list();
629         for (cur = new; cur; cur = g_slist_next(cur)) {
630                 plugin = (Plugin *)cur->data;
631                 if (!g_ascii_strcasecmp(plugin->name(), name)) 
632                         break;
633                 else 
634                         plugin = NULL;
635         }
636         g_slist_free(new);
637         return plugin;
638 }
639
640 GSList *plugin_get_unloaded_list(void)
641 {
642         return g_slist_copy(unloaded_plugins);
643 }
644
645 const gchar *plugin_get_name(Plugin *plugin)
646 {
647         return plugin->name();
648 }
649
650 const gchar *plugin_get_desc(Plugin *plugin)
651 {
652         return plugin->desc();
653 }
654
655 const gchar *plugin_get_version(Plugin *plugin)
656 {
657         return plugin->version();
658 }
659
660 const gchar *plugin_get_error(Plugin *plugin)
661 {
662         return plugin->error;
663 }
664
665 /* Generally called in plugin_init() function of each plugin. It check the
666  * minimal and compiled version of claws binary required by the plugin.
667  * If (@minimum_claws_version == 0 || @compiled_claws_version == 0), don't
668  * check the corresponding version.
669  *
670  * If an error occurs {
671  *      If @error == NULL { don't allocate error string. }
672  *      If @error != NULL { error string is allocated and must be freed after 
673  *                              call function. }
674  * }
675  * Returns: FALSE if an error occurs, TRUE if all is OK.
676  */
677 gint check_plugin_version(guint32 minimum_claws_version,
678                          guint32 compiled_claws_version,
679                          const gchar *plugin_name,
680                          gchar **error)
681 {
682         guint32 claws_version = claws_get_version();
683
684         if (compiled_claws_version != 0 && claws_version > compiled_claws_version) {
685                 if (error != NULL) {
686                         *error = (plugin_name && *plugin_name)
687                                 ? g_strdup_printf(_("Your version of Claws Mail is newer than the "
688                                                         "version the '%s' plugin was built with."),
689                                                 plugin_name)
690                                 : g_strdup(_("Your version of Claws Mail is newer than the "
691                                                         "version the plugin was built with."));
692                 }
693                 return FALSE;
694         }
695
696         if (minimum_claws_version != 0 && claws_version < minimum_claws_version) {
697                 if (error != NULL) {
698                         *error = (plugin_name && *plugin_name)
699                                 ? g_strdup_printf(_("Your version of Claws Mail is too old for "
700                                                         "the '%s' plugin."), plugin_name)
701                                 : g_strdup(_("Your version of Claws Mail is too old for the plugin."));
702                 }
703                 return FALSE;
704         }
705         return TRUE;
706 }