Fix unwanted IMAP connections on startup caused by processing rules.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 17 Apr 2018 19:17:34 +0000 (21:17 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 17 Apr 2018 19:17:34 +0000 (21:17 +0200)
The culprit was a combination of folder_item_prefs_clear()
setting item->enable_processing to TRUE even though default
value should be FALSE, and initial_processing() not skipping
over root folders, which do not have this variable later set
to correct default value in xml_to_folder_item().

Closes bug #3993: Claws Mail connects to IMAP server when it should not

src/folder_item_prefs.c
src/main.c

index e54bff04c253b77b2364e511a09a11cd5be420a8..d65423babe70bbe880121c3611a0fe4a578a400e 100644 (file)
@@ -201,8 +201,8 @@ static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs)
        prefs->save_copy_to_folder = FALSE;
        prefs->color = 0;
 
-        prefs->enable_processing = TRUE;
-        prefs->enable_processing_when_opening = TRUE;
+       prefs->enable_processing = FALSE;
+       prefs->enable_processing_when_opening = FALSE;
        prefs->processing = NULL;
 
        prefs->newmailcheck = TRUE;
index a0b8f82196c8a10cf3233c80feeee2d1c74c8efd..89e51e951df60c459cc22226060db24905f812cc 100644 (file)
@@ -2096,8 +2096,7 @@ static void initial_processing(FolderItem *item, gpointer data)
                              : _("top level folder"));
        g_free(buf);
 
-       
-       if (item->prefs->enable_processing) {
+       if (folder_item_parent(item) != NULL && item->prefs->enable_processing) {
                item->processing_pending = TRUE;
                folder_item_apply_processing(item);
                item->processing_pending = FALSE;