check.milter: fail_open does not cover a milter session-dial failure
还没有人认领这个 Issue。
评估
调研方向
阅读 internal/check/milter/milter.go,尤其是 CheckStateForMsg 和现有的 ioError 处理。检查 PR #865 中提到的回归测试,并验证启用 fail_open 时无法访问的 milter 会未经检查地接受消息,同时测试通过。
由索引模型根据 Issue 内容生成。
描述
Summary
check.milter's fail_open directive is documented to let a message through when the milter can't be consulted, but it silently doesn't cover one specific failure mode: the milter being completely unreachable when maddy tries to establish a session.
Root cause
CheckStateForMsg (internal/check/milter/milter.go) dials the milter backend via c.cl.Session() and returns any error unconditionally. This happens before a *state exists, so the failure never reaches ioError() — the only place fail_open is actually checked. Result: with fail_open set, a message is still hard-rejected (a real SMTP-level error handed back to the original sender) if the milter is simply down — exactly the case fail_open exists to guard against.
Reproduction
Configure check.milter with fail_open: true pointing at a milter address that's genuinely unreachable (e.g. nothing listening on that port), then send a message through. Expected: message accepted unchecked, per fail_open. Actual: a hard SMTP-level rejection.
Fix
I've prepared and tested a fix — handles the dial failure the same way ioError() already handles a later I/O failure — and opened it as #865, with a regression test that fails against unpatched code and passes with the fix.
Apologies for the PR arriving before this issue — I realize CONTRIBUTING.md's process is to raise the issue first. Filing this now so there's a proper place to discuss the bug alongside the PR.
- 主要语言
- Go
- 星标
- 6.1k
- 派生
- 327
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
foxcpp/maddy 的其他 Issue
-
ready-for-release
难度 1/5 1 小时以内 新手友好度 65/100
-
bug
难度 3/5 1-2 天 新手友好度 55/100
-
bug invalid
-
bug
-
new feature
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
acceptance-tests phase-coding schema-coverage testing triaged
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100