diff --git a/src/managesieve-login/managesieve-login-settings-plugin.c b/src/managesieve-login/managesieve-login-settings-plugin.c
index 9e6f964890dfb2f38e1ec755beeaf80b15b409d7..3f59a2351f86541e8d4495980e7d260452c0eae1 100644
--- a/src/managesieve-login/managesieve-login-settings-plugin.c
+++ b/src/managesieve-login/managesieve-login-settings-plugin.c
@@ -19,6 +19,7 @@
 
 typedef enum { CAP_SIEVE, CAP_NOTIFY } capability_type_t;
 
+bool capability_dumped = FALSE;
 static char *capability_sieve = NULL;
 static char *capability_notify = NULL;
 
@@ -197,10 +198,9 @@ static void managesieve_login_config_parser_begin(struct config_parser_context *
 	if (*ctx->module != '\0' && strcmp(ctx->module, "managesieve-login") != 0)
 		return;
 
-	if ( capability_sieve == NULL ) {
-		if ( !capability_dump() ) {
-			capability_sieve = "";
-		}
+	if ( !capability_dumped ) {
+		(void)capability_dump();
+		capability_dumped = TRUE;
 	}
 
 	if ( capability_sieve != NULL )