Allow Sieve config without userid without warning
[claws.git] / src / plugins / managesieve / sieve_prefs.c
index ec3713082bf6e02dd3edd9edd88cd213e83b1a6c..2e2d0e9b8b475e01cbe22406e421fba59a4155c1 100644 (file)
@@ -526,8 +526,9 @@ struct SieveAccountConfig *sieve_prefs_account_get_config(
                         * to read the 10th element in order not to break older
                         * configurations, and to move the password to password
                         * store.
-                        * If there are not 10 nor 9 elements, something is wrong. */
-               if (num != 9) {
+                        * The userid may be missing if it is unset.
+                        * If there are not 10, 9 or 8 elements, something is wrong. */
+               if (num != 9 && num != 8) {
                        g_warning("failed reading Sieve config elements");
                }
        }
@@ -579,7 +580,7 @@ void sieve_prefs_account_set_config(
                enc_userid = g_base64_encode(config->userid, len);
        }
 
-       confstr = g_strdup_printf("%c%c %s %c%hu %hhu %hhu %hhu %s",
+       confstr = g_strdup_printf("%c%c %s %c%hu %hu %hu %hu %s",
                        config->enable ? 'y' : 'n',
                        config->use_host ? 'y' : 'n',
                        config->host && config->host[0] ? config->host : "!",