Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

check.milter: fail_open does not cover a milter session-dial failure

未关闭
#866 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
go
领域
backend

调研方向

阅读 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

foxcpp/maddy 的其他 Issue

查看 foxcpp/maddy 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。