Description
Bit of a history with this one:
The issue description is documenting any concerns / knowledge regarding this docker account, so that a future PR can justify renaming it to something more appropriate such as vmail / dms-vmail.
Before Dovecot - Creation of docker user + group (Dockerfile)
The docker user and group created during the Dockerfile build were added via this Sep 2015 commit from the original DMS project author. The only context provided was a reference to this issue, but it's lacking information on why the account was added.
Back then I think the mail account support was quite a different story, and it's likely become irrelevant for the original purpose?
EDIT: When DMS switched from Courier to Dovecot in DMS v2 (2016), it was configured with LDA instead of LMTP, with Postfix master.cf running the process as the docker user.
Dovecot configs referencing docker user + group
April 2016 - DMS migrated from Courier + Cyrus to Dovecot, which introduced various configs referencing the docker user and group:
Dovecot vmail user / group and common 5000 ID
Dovecot Docs - Service Config notes various processes that have a default of user=root, with advice that you could set an explicit non-privileged user instead when all mail accounts would belong to a single UID. Otherwise the processes only temporarily run as root and drop to the UID returned from the UserDB lookup result.
I haven't looked into the reasoning for 5000 as the UID/GID choice, there didn't appear to be any discussion about it in DMS. It does seem to be common advice found online though (EDIT: Seems that it might have originated from this Dovecot doc (which presently notes it's outdated and from 2010):
/var/mail ownership and sticky-bit
Presently at startup and when check-for-changes.sh service is running, chown -R is applied to /var/mail for the 5000:5000 ownership.
There wasn't much context about how this arrived in the project as a fix/workaround (a follow-up limited the scan depth to avoid applying further if permissions looked correct for the scanned directory).
- A recent PR that will allow making the vmail ID
5000 configurable revealed the common failures, which came down to /var/mail ownership not aligning with the Dovecot user / group preventing it from creating files to store mail.
- It's probably fine to follow earlier advice above from Dovecot docs and keep and leverage the default
mail group? IIRC this location was configured with a sticky-bit, like this discusses.
- NOTE: Earlier PR discussion regarding sticky-bit I have various comments there, one documenting a gotcha with losing sticky-bit from some operations depending on kernel support.
- Setting
vmail as user and group is probably fine, but may not need to be done beyond /var/mail (while we do have our own default layout with /var/mail/{fqdn}/{account}/, it is possible to configure that to be one level less).
supervisord Web UI
Unrelated to the above, there is another config that has a similar user (docker-mailserver) + password for the supervisord web UI when enabled: #1758
May 2025
Identified an issue with fetchmail when configured with --mda option to deliver to Dovecot. The fetchmail process needs to match the UID/GID of user to deliver to in the Dovecot UserDB, or it needs to run as root for setuid/setgid to work.
Description
Bit of a history with this one:
grepto track down 🤣5000:5000static vmail user and group and the relevance AFAIK is only for Dovecot. Possibly only when regarding/var/mailownership./var/mailwhich is mostly a subset of our LDAP users. Ideally we can drop thechown -Rlogic (or shift it into asetup ...command as a troubleshooting tool we can document scenarios for).The issue description is documenting any concerns / knowledge regarding this
dockeraccount, so that a future PR can justify renaming it to something more appropriate such asvmail/dms-vmail.5000:5000is our default, but with v13 this becomes configurable via ENV.Before Dovecot - Creation of
dockeruser + group (Dockerfile)The
dockeruser and group created during theDockerfilebuild were added via this Sep 2015 commit from the original DMS project author. The only context provided was a reference to this issue, but it's lacking information on why the account was added.Back then I think the mail account support was quite a different story, and it's likely become irrelevant for the original purpose?
EDIT: When DMS switched from Courier to Dovecot in DMS v2 (2016), it was configured with LDA instead of LMTP, with Postfix
master.cfrunning the process as thedockeruser.Dovecot configs referencing
dockeruser + groupApril 2016 - DMS migrated from Courier + Cyrus to Dovecot, which introduced various configs referencing the
dockeruser and group:service auth { ... }provides a bit of insight. This was also part of the original Dovecot config support, and presumably not serving a purpose anymore either. I've not seen thisservice auth { ... }configuration forauth-userdb/auth-mastermentioned in common setup guides (Dovecot docs, and a few others that only touch on the Postfix SASL socket).auth-userdbconfig with thevmailuser and group.mail_privileged_groupMboxsection, where it references/var/maillocation to allow Dovecot to create locks.mailwhich I believe is the default for/var/mail(at least with the Debian base image), we may not need to bother withchown -Rat all 🤔privileged_groupis a similar setting for service configs, but advises to usemail_privileged_group.uid+gidoverrides to enforce the staticdockeruser and group (LDAP can override this via ENV + attributes from filter query).Dovecot
vmailuser / group and common5000IDDovecot Docs - Service Config notes various processes that have a default of
user=root, with advice that you could set an explicit non-privileged user instead when all mail accounts would belong to a single UID. Otherwise the processes only temporarily run asrootand drop to the UID returned from the UserDB lookup result.I haven't looked into the reasoning for
5000as the UID/GID choice, there didn't appear to be any discussion about it in DMS. It does seem to be common advice found online though (EDIT: Seems that it might have originated from this Dovecot doc (which presently notes it's outdated and from 2010):/var/mailownership and sticky-bitPresently at startup and when
check-for-changes.shservice is running,chown -Ris applied to/var/mailfor the5000:5000ownership.There wasn't much context about how this arrived in the project as a fix/workaround (a follow-up limited the scan depth to avoid applying further if permissions looked correct for the scanned directory).
5000configurable revealed the common failures, which came down to/var/mailownership not aligning with the Dovecot user / group preventing it from creating files to store mail.mailgroup? IIRC this location was configured with a sticky-bit, like this discusses.vmailas user and group is probably fine, but may not need to be done beyond/var/mail(while we do have our own default layout with/var/mail/{fqdn}/{account}/, it is possible to configure that to be one level less).supervisordWeb UIUnrelated to the above, there is another config that has a similar user (
docker-mailserver) + password for thesupervisordweb UI when enabled: #1758May 2025
Identified an issue with fetchmail when configured with
--mdaoption to deliver to Dovecot. The fetchmail process needs to match the UID/GID of user to deliver to in the Dovecot UserDB, or it needs to run as root forsetuid/setgidto work.