[BUG] NAMESPACE accepts extra arguments instead of returning BAD

Abierto Apto para principiantes
#321 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@tharinfernando ya está trabajando en esto.

Desde el 29/11/2026.

  • #336 de @tharinfernando — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
api, backend

Línea de trabajo

Lee el despacho de NAMESPACE en internal/server/connection.go, su handler en internal/server/extension/extension.go y el helper de pruebas y las pruebas existentes en internal/server/testing_interface.go. Sigue el patrón indicado en #263 y #260: pasa las partes tokenizadas y rechaza los argumentos adicionales antes de realizar cualquier otro trabajo. Añade una prueba para A1 NAMESPACE extra que compruebe la respuesta BAD y confirme que no se realizó ningún otro trabajo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Go
Estrellas
12
Forks
13
Merge medio
2 d 3 h
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenGovMail/raven

Todos los issues de OpenGovMail/raven

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.