carrier/crates
Kayos f7e698b09f smtp: extract validate_send_input + 9 unit tests for size caps
Refactor: pull the pre-flight validation block out of send() into a
standalone validate_send_input() function. send() now starts with a
single validate_send_input(&input)? call. Behavior identical; the
extraction is purely so unit tests can exercise the validation paths
without standing up a fake SMTP server.

New tests (9):
- validate_accepts_minimal_input (the happy path)
- validate_rejects_empty_to
- validate_rejects_too_many_recipients (150 > 100 cap)
- validate_recipient_cap_boundary_passes (exactly 100 OK)
- validate_rejects_oversized_body
- validate_rejects_oversized_body_html
- validate_rejects_too_many_attachments
- validate_rejects_oversized_attachment_encoded (pre-decode bound)
- validate_accepts_at_attachment_boundary

Test count: 18 -> 27. All passing.
2026-05-21 08:23:18 -07:00
..
mail-mcp smtp: extract validate_send_input + 9 unit tests for size caps 2026-05-21 08:23:18 -07:00