foxcpp / foxcpp/maddy

io_debug: Extra option for only logging on failure

Abierto
#776 0 comentarios 0 reacciones 0 asignados Ver en GitHub
new feature
Lenguaje dominante
Go
Estrellas
6.1k
Forks
327
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

# Use case

io_debug is currently [a boolean flag](https://maddy.email/reference/endpoints/smtp/#io_debug-boolean).

Turning it on to log everything when debugging either Maddy's sources or on bringing up a new server makes sense. However, it would also be useful for longer-term debugging of more complex issues with server setup if it could log the entire communication only when an error has occurred. Thus successful connections do not need the extra info, whilst problem communication can capture this for days or weeks without needing to generate overly verbose logs.

There is also the possibility that extended logging on failure/rejections/etc. could be valuable for feeding into systems like fail2ban or CrowdSec for blacklisting spam and attackers, enabling such systems to differentiate better between malicious connections and innnocent failures.

# Your idea for a solution

How your solution would work in general?
I haven;t yet looked to see how difficult this would be in terms of implementation. But for the interface, simply adding a third option to the config directive - "on", "off", and e.g. "on_failure" seems suitable to me.

- [x] I'm willing to help with the implementation
* I think I can implement but would appreciate guidance and a review of changes to ensure it's implemented in the required places.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza rastreando el manejo existente de la configuración de io_debug y la ruta de registro de la comunicación SMTP; el issue no proporciona ningún punto de entrada de archivo o de prueba. Confirma cómo se identifican los resultados exitosos y los errores, y luego define pruebas que cubran el comportamiento off, on y on_failure, de modo que la nueva opción registre la comunicación completa solo para las interacciones fallidas.

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

Evaluación

Stack tecnológico
go
Área
backend, observability
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.