[BUG] UNSELECT accepts extra arguments instead of returning BAD

Aperta Adatta ai principianti
#322 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.

  • #335 di @tharinfernando — aperta

Valutazione

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

Direzione di ricerca

Inizia da internal/server/connection.go, nel dispatch di handleClient per UNSELECT, poi leggi internal/server/selection/selection.go e l’helper di test in internal/server/testing_interface.go. Segui il modello di convalida degli argomenti usato per NOOP o CAPABILITY e aggiorna i test interessati. Il lavoro è completato quando A1 UNSELECT extra restituisce BAD e lascia la mailbox selezionata, mentre un UNSELECT valido continua a funzionare.

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 select a mailbox.
  2. Send UNSELECT with an extra argument, e.g. A1 UNSELECT extra.
Expected Behavior

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

Actual Behavior

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

Impact: A1 UNSELECT extra leaves the Selected state and returns OK instead of returning BAD and keeping the mailbox selected.

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 selection.HandleUnselect.
  • At the top of the handler, if len(parts) > 2, send <tag> BAD UNSELECT 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 UNSELECT 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.