diff --git a/apache/Dockerfile b/apache/Dockerfile
index 1c0d7341e..c2e5ecce0 100644
--- a/apache/Dockerfile
+++ b/apache/Dockerfile
@@ -115,7 +115,7 @@ RUN set -ex; \
 	rm -rf /usr/src/roundcubemail/installer; \
 	chown -R www-data:www-data /usr/src/roundcubemail/logs; \
 # Create the config dir
-	mkdir -p /var/roundcube/config
+	mkdir -p /var/roundcube/config /var/roundcube/enigma
 
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["apache2-foreground"]
diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh
index a797d861b..176173aec 100755
--- a/apache/docker-entrypoint.sh
+++ b/apache/docker-entrypoint.sh
@@ -150,6 +150,11 @@ if  [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then
     echo "\$config['spellcheck_uri'] = '${ROUNDCUBEMAIL_SPELLCHECK_URI}';" >> config/config.docker.inc.php
   fi
 
+  # If the "enigma" plugin is enabled but has no storage configured, inject a default value for the mandatory setting.
+  if $(echo $ROUNDCUBEMAIL_PLUGINS | grep -Eq '\benigma\b') && ! grep -qr enigma_pgp_homedir /var/roundcube/config/; then
+    echo "$config['enigma_pgp_homedir'] = '/var/roundcube/enigma';" >> config/config.docker.inc.php
+  fi
+
   # include custom config files
   for fn in `ls /var/roundcube/config/*.php 2>/dev/null || true`; do
     echo "include('$fn');" >> config/config.docker.inc.php
diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile
index 8075fed9a..aa889bac2 100644
--- a/fpm-alpine/Dockerfile
+++ b/fpm-alpine/Dockerfile
@@ -92,10 +92,7 @@ ENV ROUNDCUBEMAIL_KEYID "F3E4 C04B B3DB 5D42 15C4  5F7F 5AB2 BAA1 41C4 F7D5"
 
 # Download package and extract to web volume
 RUN set -ex; \
-	apk add --no-cache --virtual .fetch-deps \
-		gnupg \
-	; \
-	\
+	apk add --no-cache gnupg;
 	curl -o roundcubemail.tar.gz -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
 	curl -o roundcubemail.tar.gz.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
 	export GNUPGHOME="$(mktemp -d)"; \
@@ -111,9 +108,8 @@ RUN set -ex; \
 	rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
 	rm -rf /usr/src/roundcubemail/installer; \
 	chown -R www-data:www-data /usr/src/roundcubemail/logs; \
-	apk del .fetch-deps; \
 # Create the config dir
-	mkdir -p /var/roundcube/config
+	mkdir -p /var/roundcube/config /var/roundcube/enigma
 
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["php-fpm"]
diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh
index a797d861b..176173aec 100755
--- a/fpm-alpine/docker-entrypoint.sh
+++ b/fpm-alpine/docker-entrypoint.sh
@@ -150,6 +150,11 @@ if  [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then
     echo "\$config['spellcheck_uri'] = '${ROUNDCUBEMAIL_SPELLCHECK_URI}';" >> config/config.docker.inc.php
   fi
 
+  # If the "enigma" plugin is enabled but has no storage configured, inject a default value for the mandatory setting.
+  if $(echo $ROUNDCUBEMAIL_PLUGINS | grep -Eq '\benigma\b') && ! grep -qr enigma_pgp_homedir /var/roundcube/config/; then
+    echo "$config['enigma_pgp_homedir'] = '/var/roundcube/enigma';" >> config/config.docker.inc.php
+  fi
+
   # include custom config files
   for fn in `ls /var/roundcube/config/*.php 2>/dev/null || true`; do
     echo "include('$fn');" >> config/config.docker.inc.php
diff --git a/fpm/Dockerfile b/fpm/Dockerfile
index 00ef925ce..0fba5ccde 100644
--- a/fpm/Dockerfile
+++ b/fpm/Dockerfile
@@ -115,7 +115,7 @@ RUN set -ex; \
 	rm -rf /usr/src/roundcubemail/installer; \
 	chown -R www-data:www-data /usr/src/roundcubemail/logs; \
 # Create the config dir
-	mkdir -p /var/roundcube/config
+	mkdir -p /var/roundcube/config /var/roundcube/enigma
 
 ENTRYPOINT ["/docker-entrypoint.sh"]
 CMD ["php-fpm"]
diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh
index a797d861b..176173aec 100755
--- a/fpm/docker-entrypoint.sh
+++ b/fpm/docker-entrypoint.sh
@@ -150,6 +150,11 @@ if  [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then
     echo "\$config['spellcheck_uri'] = '${ROUNDCUBEMAIL_SPELLCHECK_URI}';" >> config/config.docker.inc.php
   fi
 
+  # If the "enigma" plugin is enabled but has no storage configured, inject a default value for the mandatory setting.
+  if $(echo $ROUNDCUBEMAIL_PLUGINS | grep -Eq '\benigma\b') && ! grep -qr enigma_pgp_homedir /var/roundcube/config/; then
+    echo "$config['enigma_pgp_homedir'] = '/var/roundcube/enigma';" >> config/config.docker.inc.php
+  fi
+
   # include custom config files
   for fn in `ls /var/roundcube/config/*.php 2>/dev/null || true`; do
     echo "include('$fn');" >> config/config.docker.inc.php