SA plugin: better way to make sure Unix sockets are not used in Windows,
authorwwp <wwp@free.fr>
Wed, 11 Apr 2018 17:19:50 +0000 (19:19 +0200)
committerwwp <wwp@free.fr>
Wed, 11 Apr 2018 17:19:50 +0000 (19:19 +0200)
from a config coming from Unix: do it when loading the configs, not
when handling the plug-in preferences in GUI.

src/plugins/spamassassin/spamassassin.c
src/plugins/spamassassin/spamassassin_gtk.c

index 5df6de1c588b45c5a208344af8ba81d5554896dd..f01bd92b2f8e728940a0677b05548c4ea5bfbe62 100644 (file)
@@ -547,6 +547,11 @@ gint plugin_init(gchar **error)
                *error = g_strdup(_("Failed to get username"));
                return -1;
        }
+#ifdef G_OS_WIN32
+       /* no Unix socket in Windows, and in case our config comes from Unix, switch to TCP */
+       if (config.transport == SPAMASSASSIN_TRANSPORT_UNIX)
+               config.transport = SPAMASSASSIN_TRANSPORT_TCP;
+#endif
        spamassassin_gtk_init();
                
        debug_print("SpamAssassin plugin loaded\n");
index d0439a6daf38e4896d1cc4c9ec2fba76eb8d6005..fe0ba121863b7a4695af07a65455c67889a04aa7 100644 (file)
@@ -524,11 +524,6 @@ static void spamassassin_create_widget_func(PrefsPage * _page,
        page->whitelist_ab = whitelist_ab_checkbtn;
        page->whitelist_ab_folder_combo = whitelist_ab_folder_combo;
 
-#ifdef G_OS_WIN32
-       /* no Unix socket in Windows, and in case our config comes from Unix, switch to TCP */
-       if (config->transport == SPAMASSASSIN_TRANSPORT_UNIX)
-               config->transport = SPAMASSASSIN_TRANSPORT_TCP;
-#endif
        active = 0;
        for (i = 0; i < (sizeof(transports) / sizeof(struct Transport)); i++) {