{"record":{"id":"556d487dbcff7809","repo":"Billionmail/BillionMail","slug":"dovecot-conf-dir-not-found-s","errorCode":null,"errorMessage":"dovecot conf dir not found: %s","messagePattern":"dovecot conf dir not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/mail_boxes/init_quota_plugin.go","lineNumber":39,"sourceCode":"// Modify dovecot.conf, 20-pop3.conf, and 90-quota.conf.\n// Rebuild dovecot-sql.conf.ext\n// Check all mailboxes and add the maildirsize file (make sure the file permissions are correct)\n\nfunc InitQuotaPluginAndUpdateUsedSpace(ctx context.Context) error {\n\tif public.HostWorkDir == \"\" {\n\t\treturn errors.New(\"HostWorkDir not set\")\n\t}\n\n\tmarkPath := public.AbsPath(\"../core/data/quota_init_done.mark\")\n\n\tif gfile.Exists(markPath) {\n\t\treturn nil\n\t}\n\n\tconfRoot := public.AbsPath(\"../conf/dovecot\")\n\n\tif _, err := os.Stat(confRoot); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"dovecot conf dir not found: %s\", confRoot)\n\t}\n\n\t// 1. Modify dovecot.conf\n\tif err := ensureDovecotConf(confRoot); err != nil {\n\t\treturn err\n\t}\n\n\t// 2. Modify 20-pop3.conf\n\tif err := ensurePop3Conf(confRoot); err != nil {\n\t\tg.Log().Debug(ctx, \" Modify 20-pop3.conf err:\", err)\n\t\treturn err\n\t}\n\n\t// 3. /conf.d/90-quota.conf\n\tif err := ensureQuotaConf(confRoot); err != nil {\n\t\tg.Log().Debug(ctx, \" Modify /conf.d/90-quota.conf err:\", err)\n\t\treturn err\n\t}","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/mail_boxes/init_quota_plugin.go#L21-L57","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nconfRoot := public.AbsPath(\"../conf/dovecot\")\n// after\nconfRoot := public.AbsPath(\"../conf/dovecot\")\nif fi, err := os.Stat(confRoot); err != nil || !fi.IsDir() {\n\treturn fmt.Errorf(\"dovecot conf dir not found: %s (HostWorkDir=%s)\", confRoot, public.HostWorkDir)\n}","handlingStrategy":"validation","validationCode":"confRoot := filepath.Join(public.HostWorkDir, \"..\", \"conf\", \"dovecot\")\nif fi, err := os.Stat(confRoot); err != nil || !fi.IsDir() {\n\treturn fmt.Errorf(\"conf/dovecot missing under work dir %s\", public.HostWorkDir)\n}","typeGuard":null,"tryCatchPattern":"if err := mail_boxes.InitQuotaPluginAndUpdateUsedSpace(ctx); err != nil && strings.HasPrefix(err.Error(), \"dovecot conf dir not found\") {\n\tlog.Printf(\"deployment incomplete — restore conf/dovecot: %s\", err)\n}","preventionTips":["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"],"tags":["filesystem","dovecot","configuration","missing-path"],"backgroundTag":"missing-config-directory","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}