chore(maildir): 补充邮件目录归属处理
Docker Release / Check web and api (push) Waiting to run
Docker Release / Resolve release tag (push) Blocked by required conditions
Docker Release / Build and publish all-in-one (push) Blocked by required conditions
Docker Release / Build and publish api (push) Blocked by required conditions
Docker Release / Build and publish web (push) Blocked by required conditions
Docker Release / Build and publish dovecot (push) Blocked by required conditions
Docker Release / Build and publish postfix (push) Blocked by required conditions
Docker Release / Build and publish rspamd (push) Blocked by required conditions
Docker Release / Create GitHub release (push) Blocked by required conditions

- 新增 Unix 与非 Unix 平台的目录归属处理实现。
- 在写入、移动和标记邮件时同步调整 Maildir 目录与文件归属。
- 扩展目录初始化逻辑,确保父目录与子目录权限一致。
This commit is contained in:
LanQin
2026-06-24 18:22:24 +08:00
parent 947e3ad248
commit 13332136c2
3 changed files with 55 additions and 3 deletions
@@ -0,0 +1,17 @@
//go:build unix
package app
import "os"
const (
maildirOwnerUID = 5000
maildirOwnerGID = 5000
)
func applyMaildirOwnership(path string) error {
if os.Geteuid() != 0 {
return nil
}
return os.Chown(path, maildirOwnerUID, maildirOwnerGID)
}