kpv
February 5, 2022, 9:28pm
1
Currently HestiaCP maintains the info about mail users in 3 different files:
/usr/local/hesta/data/users/$USER/mail/$DOMAIN.conf
/etc/exim4/domains/$DOMAIN/passwd
/etc/exim4/domains/$DOMAIN/accounts
It seems to me that the accounts
file may be unnecessary, since its data is also contained in the passwd
file.
It also seems that HestiaCP’s Dovecot uses only the passwd
file (and I could find no references to the accounts
file outside of HestiaCP own code):
# more /etc/dovecot/conf.d/auth-passwdfile.conf.ext
passdb {
driver = passwd-file
args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd
}
userdb {
driver = passwd-file
args = username_format=%n /etc/exim4/domains/%d/passwd
}
PS: Some background about Dovecot’s passdb vs userdb
https://doc.dovecot.org/configuration_manual/authentication/password_databases_passdb/
https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/
kpv
February 5, 2022, 9:50pm
2
I also opened an issue about it:
opened 09:46PM - 05 Feb 22 UTC
bug
### Describe the bug
Not a "bug" per se, more an opportunity to optimize some v… -* scripts.
Currently HestiaCP maintains the info about its mail users in 3 different files:
1. /usr/local/hesta/data/users/$USER/mail/$DOMAIN.conf
2. /etc/exim4/domains/$DOMAIN/passwd
3. /etc/exim4/domains/$DOMAIN/accounts
It seems to me that the `accounts` file may be unnecessary, since its data is also contained in the `passwd` file.
HestiaCP’s Dovecot uses only the `passwd` file (note: the passdb and userdb can be separate files, or can be a combined file in /etc/passwd-style layout):
```
# more /etc/dovecot/conf.d/auth-passwdfile.conf.ext
passdb {
driver = passwd-file
args = scheme=MD5-CRYPT username_format=%n /etc/exim4/domains/%d/passwd
}
userdb {
driver = passwd-file
args = username_format=%n /etc/exim4/domains/%d/passwd
}
```
and I could find any references to the `accounts` file outside of HestiaCP own code.
PS: Some background about Dovecot’s passdb vs userdb
https://doc.dovecot.org/configuration_manual/authentication/password_databases_passdb/
https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/
### Tell us how to replicate the bug
Check the code of
```
/usr/local/hestia/bin/v-add-mail-domain
/usr/local/hestia/bin/v-add-mail-account:
/usr/local/hestia/bin/v-delete-mail-account:
```
### Which components are affected by this bug?
Control Panel Backend
### Hestia Control Panel Version
1.5.7
### Operating system
Debian 10
### Log capture
_No response_
We could probably comment-out the lines creating/editing file accounts
in
/usr/local/hestia/bin/v-add-mail-domain
/usr/local/hestia/bin/v-add-mail-account
/usr/local/hestia/bin/v-delete-mail-account
kpv
February 5, 2022, 10:07pm
3
HestiaCP is already using the combined format (and not a separate userdb), because its passwd includes fields prefixed with userdb_
, which otherwise would be be treated as passdb extra fields
More at User database extra fields — Dovecot documentation
user:{plain}pass:1000:1000::/home/user::userdb_mail=mbox:~/mail userdb_quota_rule=*:storage=100M userdb_namespace/default/separator=/
user2:{plain}pass2:1001:1001::/home/user2::userdb_mail=maildir:~/Maildir userdb_quota_rule=*:storage=200M
This subject is also relevant to @eris idea of storing Exim4 per user send limits in the domain’s /etc/exim4/domains/$DOMAIN/passwd
file.
hestiacp:main
← madito:main
opened 10:00AM - 09 Nov 21 UTC
eris
February 5, 2022, 10:33pm
4
Please keep the location in one location ^^
It makes more sense …
eris
February 5, 2022, 10:47pm
6
Will close the discussion here. Please move to Github…