diff --git a/src/lib-sieve/sieve-actions.c b/src/lib-sieve/sieve-actions.c
index 8e71d4f68456711ceba12787d06d248f2dc3bdc1..45d51ae592b81195271715e170a43e6176b94d2b 100644
--- a/src/lib-sieve/sieve-actions.c
+++ b/src/lib-sieve/sieve-actions.c
@@ -220,6 +220,8 @@ static struct mailbox *act_store_mailbox_open
 			*storage = NULL;
 			return NULL;
 		}
+
+		*storage = (*ns_r)->storage;
 	}
 
 	/* First attempt at opening the box */