You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mail: public folders reject messages when they exceed the default mailbox quota #8305
In the Mail application settings, set a default mailbox quota, for example 3 GB
Create one or more public folders and send messages to them until their combined size is bigger than the default quota
Send another message to a public folder address
Expected behavior
Public folders have no size limit. The default mailbox quota applies only to user mailboxes, and users keep their configured quotas.
Actual behavior
The message is rejected with:
552 5.2.2 Quota exceeded (mailbox for user is full)
All public folders are stored in the mailbox of an internal technical user, vmail. Dovecot (the IMAP server) applies the default mailbox quota to every user, so vmail gets it too. All public folders together share that one limit. The vmail user is not listed on the Mailboxes page, so its quota can't be changed from the user interface.
Workaround
See the comment below.
Components
Mail 1.9.3 and earlier. The problem is still present in Mail 2.0.0-beta.1 (Dovecot 2.4).
changed the title [-]Mail: fix default quota enforcement on the vmail user for public folders[/-][+]Mail: public folders reject messages when they exceed the default mailbox quota[/+]on Nov 11, 2026
The workaround in the description is lost every time the Mail application settings are saved from the user interface, because Dovecot is reloaded and /etc/dovecot/users is rebuilt. The following workaround survives both reloads and restarts: every time the Dovecot container starts, it patches the script that rebuilds the file (reload-config), so every later reload writes the vmail quota rule too.
It applies to Mail 1.x (Dovecot 2.3). Replace mail1 with the Mail module ID.
runagent -m mail1
mkdir -p scripts
cat > ./scripts/vmail-quota.sh <<'EOF'#!/bin/sh# Workaround for NethServer/dev#8305: no quota for vmail (public folders).set -eu# 1. Patch reload-config, so every reload writes the vmail quota rulepodman exec -u root dovecot sed -i \ 's|^\(echo "vmail:{plain}${DOVECOT_VMAIL_PASS}::::::\)" > /etc/dovecot/users$|\1userdb_quota_rule=*:storage=0M" > /etc/dovecot/users|' \ /usr/local/bin/reload-config# 2. Fix the users file already written when the container startedpodman exec -u root dovecot sed -i \ '/^vmail:/ s|::::::$|::::::userdb_quota_rule=*:storage=0M|' \ /etc/dovecot/usersEOF
chmod 700 ./scripts/vmail-quota.sh
systemctl --user edit dovecot.service
In the editor, add at the top of the drop-in file:
Tested with the mail-dovecot:1.9.3 image (Dovecot 2.3.21.1) and a 10 MB default quota: before the workaround vmail had a 10240 KB limit. After the script, and after each reload-config run (the same command run when settings are saved), vmail had no limit. The systemd drop-in itself was not exercised on a real Mail 1.9.x module.
Remove the workaround before upgrading to the Mail release that fixes this issue, which uses Dovecot 2.4, where the userdb_quota_rule syntax is no longer valid:
The testing image ghcr.io/nethserver/mail:2.0.0-beta.2 is available, with the fix from NethServer/ns8-mail#342.
The internal vmail user, which holds the public folders, is now exempted from the default mailbox quota: its quota is unlimited by default. Administrators can limit the total size of public folders with the DOVECOT_VMAIL_QUOTA_MB environment variable (value in MB, 0 = unlimited), as described in the module README.
Test cases for verification:
Set a default mailbox quota, for example 50 MB, from the Mail settings. A user without a custom quota gets that limit, while podman exec dovecot doveadm quota get -u vmail shows no STORAGE limit (-).
Send messages to public folders until their combined size is bigger than the default quota: they are still delivered, with no "Quota exceeded" error.
Set DOVECOT_VMAIL_QUOTA_MB to 60 and reload Dovecot: the vmail STORAGE limit becomes 61440 KB, and user quotas do not change.
Remove the variable and set the default quota back to unlimited: both vmail and users have no limit.
Update an existing installation where the problem happens: public folders accept messages again after the update, with no manual steps.
Automated coverage: tests/40__api/60__dovecot.robot (The vmail user is exempted from the default quota, The vmail user quota is overridden by the environment, Restore the vmail and default quota).
Tested on Rocky Linux 9.8, core 3.25.1. The other test cases are covered by the automated tests: this checks the update of an existing installation where the problem happens.
Mail 1.9.3 with a 1 MB default mailbox quota and a public mailbox qapub with the address qapub@example.org. After about 800 KB of messages, doveadm quota get -u vmail shows a 1024 KB limit, and the next message is bounced with 552 5.2.2 ... Quota exceeded (mailbox for user is full). Problem reproduced.
Update to 2.0.0-beta.6, with no manual steps: vmail has no STORAGE limit (-), and three more 400 KB messages to qapub@example.org are delivered (2035 KB total). The user qa2 keeps the 1024 KB default limit.
Activity
[-]Mail: fix default quota enforcement on the vmail user for public folders[/-][+]Mail: public folders reject messages when they exceed the default mailbox quota[/+]DavidePrincipi commentedon Nov 11, 2026
Persistent workaround
The workaround in the description is lost every time the Mail application settings are saved from the user interface, because Dovecot is reloaded and
/etc/dovecot/usersis rebuilt. The following workaround survives both reloads and restarts: every time the Dovecot container starts, it patches the script that rebuilds the file (reload-config), so every later reload writes thevmailquota rule too.It applies to Mail 1.x (Dovecot 2.3). Replace
mail1with the Mail module ID.In the editor, add at the top of the drop-in file:
Then apply it:
Notes:
ExecStartPostruns after the unit's ownExecStartPostcommands, which wait for Dovecot to be up, so the users file already exists.sedcommands match only the unpatched text.-means that if the script fails, Dovecot starts anyway without the workaround.Check that the quota rule is still there after a reload:
systemctl --user reload dovecot podman exec dovecot doveadm quota get -u vmailThe
STORAGElimit ofvmailmust be-(unlimited).Tested with the
mail-dovecot:1.9.3image (Dovecot 2.3.21.1) and a 10 MB default quota: before the workaroundvmailhad a 10240 KB limit. After the script, and after eachreload-configrun (the same command run when settings are saved),vmailhad no limit. The systemd drop-in itself was not exercised on a real Mail 1.9.x module.Remove the workaround before upgrading to the Mail release that fixes this issue, which uses Dovecot 2.4, where the
userdb_quota_rulesyntax is no longer valid:Merge pull request #342 from NethServer/vmail-quota
DavidePrincipi commentedon Nov 11, 2026
The testing image
ghcr.io/nethserver/mail:2.0.0-beta.2is available, with the fix from NethServer/ns8-mail#342.The internal
vmailuser, which holds the public folders, is now exempted from the default mailbox quota: its quota is unlimited by default. Administrators can limit the total size of public folders with theDOVECOT_VMAIL_QUOTA_MBenvironment variable (value in MB,0= unlimited), as described in the module README.Test cases for verification:
podman exec dovecot doveadm quota get -u vmailshows no STORAGE limit (-).DOVECOT_VMAIL_QUOTA_MBto60and reload Dovecot: thevmailSTORAGE limit becomes 61440 KB, and user quotas do not change.vmailand users have no limit.Automated coverage:
tests/40__api/60__dovecot.robot(The vmail user is exempted from the default quota, The vmail user quota is overridden by the environment, Restore the vmail and default quota).DavidePrincipi commentedon Nov 27, 2026
VERIFIED
Tested on Rocky Linux 9.8, core 3.25.1. The other test cases are covered by the automated tests: this checks the update of an existing installation where the problem happens.
1.9.3with a 1 MB default mailbox quota and a public mailboxqapubwith the addressqapub@example.org. After about 800 KB of messages,doveadm quota get -u vmailshows a 1024 KB limit, and the next message is bounced with552 5.2.2 ... Quota exceeded (mailbox for user is full). Problem reproduced.2.0.0-beta.6, with no manual steps:vmailhas no STORAGE limit (-), and three more 400 KB messages toqapub@example.orgare delivered (2035 KB total). The userqa2keeps the 1024 KB default limit.