fix(mailserver): Fix dovecot users file permissions after add-user
Ensure /etc/dovecot/users has 644 permissions and root:dovecot ownership after adding a user. Without this, dovecot cannot read the passwd-file and authentication fails with "Permission denied". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
95e14c183b
commit
3aacabd5c1
@ -384,6 +384,9 @@ cmd_add_user() {
|
|||||||
if lxc_running; then
|
if lxc_running; then
|
||||||
local pass_hash=$(lxc-attach -n "$CONTAINER" -- doveadm pw -s SHA512-CRYPT -p "$password")
|
local pass_hash=$(lxc-attach -n "$CONTAINER" -- doveadm pw -s SHA512-CRYPT -p "$password")
|
||||||
echo "${email}:${pass_hash}:102:105::/var/mail/${domain}/${user}::" >> "$rootfs/etc/dovecot/users"
|
echo "${email}:${pass_hash}:102:105::/var/mail/${domain}/${user}::" >> "$rootfs/etc/dovecot/users"
|
||||||
|
# Fix permissions (dovecot needs read access)
|
||||||
|
chmod 644 "$rootfs/etc/dovecot/users"
|
||||||
|
chown root:102 "$rootfs/etc/dovecot/users"
|
||||||
else
|
else
|
||||||
error "Container not running. Start it first."
|
error "Container not running. Start it first."
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user