- Added rate limiting for outbound email sends to prevent abuse, implemented in `internal/api/mail/sendguard`. - Introduced idempotency key support for email sending to avoid duplicate submissions. - Enhanced attachment handling with new limits and validation in `internal/api/mail/limits`. - Updated outbox processing to include retry logic and circuit breaker for SMTP failures. - Improved HTML sanitization for email content to enhance security. - Added unit tests for new features, ensuring robust functionality and error handling. - Updated configuration options in `.env.example` for new mail settings.
13 lines
204 B
Go
13 lines
204 B
Go
package sanitize
|
|
|
|
import "github.com/microcosm-cc/bluemonday"
|
|
|
|
var policy = bluemonday.UGCPolicy()
|
|
|
|
func SanitizeHTML(html string) string {
|
|
if html == "" {
|
|
return ""
|
|
}
|
|
return policy.Sanitize(html)
|
|
}
|