mailsystem: dovecot: Grant roundcube user access to dynamic passwd file

This commit is contained in:
Thomas Preisner 2024-12-28 22:32:41 +01:00
parent 1b26a41aaf
commit cbdbb94512

View file

@ -77,6 +77,11 @@ with (import ./common.nix {inherit config;}); let
done done
mv "${dovecotDynamicPasswdFile}-filtered" "${dovecotDynamicPasswdFile}" mv "${dovecotDynamicPasswdFile}-filtered" "${dovecotDynamicPasswdFile}"
${lib.optionalString cfg.roundcube.enable ''
# Ensure roundcube has access to dynamic passwd file
${pkgs.acl.bin}/bin/setfacl -m "u:${config.services.phpfpm.pools.roundcube.user}:rw" "${dovecotDynamicPasswdFile}"
''}
# Prepare userdb-file # Prepare userdb-file
cat <<EOF > "${userdbFile}" cat <<EOF > "${userdbFile}"
${lib.concatStringsSep "\n" (lib.mapAttrsToList genUserdbEntry cfg.accounts)} ${lib.concatStringsSep "\n" (lib.mapAttrsToList genUserdbEntry cfg.accounts)}