Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#866 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Leggi internal/check/milter/milter.go, in particolare CheckStateForMsg e la gestione esistente di ioError. Esamina il test di regressione menzionato in PR #865 e verifica che un milter non raggiungibile con fail_open abilitato accetti il messaggio senza verificarlo mentre il test ha esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
6.1k
Fork
327
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di foxcpp/maddy

Tutte le issue di foxcpp/maddy

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.