Billionmail/BillionMail · error
dovecot conf dir not found
Error message
dovecot conf dir not found: %s
What it means
The function resolves the Dovecot configuration root as ../conf/dovecot relative to the host work dir and verifies it exists with os.Stat. This error reports the directory is absent, so the quota plugin files cannot be patched.
Solutions
- Verify the conf/dovecot directory exists relative to HostWorkDir (ls $HostWorkDir/../conf/dovecot)
- Correct public.HostWorkDir to point at the actual deployment root
- Re-deploy or restore the conf/dovecot directory from the repository/installer
- Check the error's %s value to see the exact path that was probed
Example fix
// before
confRoot := public.AbsPath("../conf/dovecot")
// after
confRoot := public.AbsPath("../conf/dovecot")
if fi, err := os.Stat(confRoot); err != nil || !fi.IsDir() {
return fmt.Errorf("dovecot conf dir not found: %s (HostWorkDir=%s)", confRoot, public.HostWorkDir)
} Defensive patterns
Strategy: validation
Validate before calling
confRoot := filepath.Join(public.HostWorkDir, "..", "conf", "dovecot")
if fi, err := os.Stat(confRoot); err != nil || !fi.IsDir() {
return fmt.Errorf("conf/dovecot missing under work dir %s", public.HostWorkDir)
} Try / catch
if err := mail_boxes.InitQuotaPluginAndUpdateUsedSpace(ctx); err != nil && strings.HasPrefix(err.Error(), "dovecot conf dir not found") {
log.Printf("deployment incomplete — restore conf/dovecot: %s", err)
} Prevention
- Ship conf/dovecot with the deployment artifact
- Validate the install layout at startup (dir + key files present)
- Keep HostWorkDir pointing at the real deployment root
- Log the resolved absolute path when the dir is missing
When it happens
Trigger: os.Stat(confRoot) returns IsNotExist: the conf/dovecot directory is missing under HostWorkDir, or HostWorkDir points at the wrong directory so the relative ../conf/dovecot path resolves nowhere.
Common situations: Partial deployment missing the conf/ directory; running from a packaged binary where ../conf/dovecot is not shipped; HostWorkDir misconfigured to an app dir instead of the deployment root; wrong install layout after upgrade.
Related errors
- 333333write new dovecot-sql.conf.ext failed
- alert settings file is empty
- alert settings file not found
- failed to read dovecot config
- failed to update BILLIONMAIL_HOSTNAME in .env file
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/556d487dbcff7809.
Report an issue: GitHub.
Appendix: source
Thrown at core/internal/service/mail_boxes/init_quota_plugin.go:39
// Modify dovecot.conf, 20-pop3.conf, and 90-quota.conf.
// Rebuild dovecot-sql.conf.ext
// Check all mailboxes and add the maildirsize file (make sure the file permissions are correct)
func InitQuotaPluginAndUpdateUsedSpace(ctx context.Context) error {
if public.HostWorkDir == "" {
return errors.New("HostWorkDir not set")
}
markPath := public.AbsPath("../core/data/quota_init_done.mark")
if gfile.Exists(markPath) {
return nil
}
confRoot := public.AbsPath("../conf/dovecot")
if _, err := os.Stat(confRoot); os.IsNotExist(err) {
return fmt.Errorf("dovecot conf dir not found: %s", confRoot)
}
// 1. Modify dovecot.conf
if err := ensureDovecotConf(confRoot); err != nil {
return err
}
// 2. Modify 20-pop3.conf
if err := ensurePop3Conf(confRoot); err != nil {
g.Log().Debug(ctx, " Modify 20-pop3.conf err:", err)
return err
}
// 3. /conf.d/90-quota.conf
if err := ensureQuotaConf(confRoot); err != nil {
g.Log().Debug(ctx, " Modify /conf.d/90-quota.conf err:", err)
return err
}View on GitHub (pinned to fc36c76c05)