[BUG] NAMESPACE accepts extra arguments instead of returning BAD

Aperta Adatta ai principianti
#321 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@tharinfernando ci sta già lavorando.

Dal 29/11/2026.

  • #336 di @tharinfernando — aperta

Valutazione

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

Direzione di ricerca

Leggi il dispatch di NAMESPACE in internal/server/connection.go, il relativo handler in internal/server/extension/extension.go e l’helper di test e i test esistenti in internal/server/testing_interface.go. Segui il modello indicato in #263 e #260: passa le parti tokenizzate e rifiuta gli argomenti aggiuntivi prima di svolgere altro lavoro. Aggiungi un test per A1 NAMESPACE extra che verifichi la risposta BAD e confermi che non è stato svolto altro lavoro.

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

Descrizione

bug good first issue
Steps to Reproduce
  1. Connect to the IMAP server and log in.
  2. Send NAMESPACE with an extra argument, e.g. A1 NAMESPACE extra.
Expected Behavior

RFC 2342 defines NAMESPACE with no arguments, so a command with extra arguments is malformed and the server should reply A1 BAD NAMESPACE takes no arguments without doing anything else.

Actual Behavior

The dispatcher in internal/server/connection.go calls extension.HandleNamespace without passing the tokenized parts, so the handler (internal/server/extension/extension.go) can't see the extra arguments. It ignores them and runs the command as normal.

Impact: A1 NAMESPACE extra returns the * NAMESPACE response and OK instead of BAD.

Relevant Logs / Screenshots

Same bug as #263 (NOOP, fixed in #315) and #260 (CAPABILITY). The fix follows the same pattern:

  • Pass parts from handleClient in internal/server/connection.go to extension.HandleNamespace.
  • At the top of the handler, if len(parts) > 2, send <tag> BAD NAMESPACE takes no arguments and return before any other work.
  • Update the test helper in internal/server/testing_interface.go and the existing tests to the new signature.
  • Add a test for A1 NAMESPACE extra that checks for the BAD reply and that nothing else happened.
Lingua principale
Go
Stelle
12
Fork
13
Merge medio
2g 3h
PR unite (30g)
8

Preparare l'ambiente

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 OpenGovMail/raven

Tutte le issue di OpenGovMail/raven

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.