mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 08:45:54 +03:00
[GH-ISSUE #241] TLSRequired option from smtpd not supported #157
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @allesdavid on GitHub (Jan 25, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/241
Context
We're working on a java application that is not currently enforcing STARTTLS usage for email sending with standard java API.
When we contact our client smtp gateway, which is requiring that the client perform a TLS negotiation before accepting any commands, we received a "530 5.7.0 Must issue a STARTTLS command first", as stated in the RFC 3207 https://www.ietf.org/rfc/rfc3207.txt.
We wanted to use mailpit as an email/SMTP validation tool for our development activities to validate the correct fixing of the application implementation regarding TLS negociation enforcement.
So we run mailpit with following command line:
mailpit --smtp-auth-file /path/to/password-file --smtp-tls-cert /path/to/cert.pem --smtp-tls-key /path/to/key.pemExpected
"530 5.7.0 Must issue a STARTTLS command first" error due to no current TLS negotiation before send command not in the include list of the RFC.
Actual
Mailpit process the request and email is sent without further warning/error.
Analysis
TLSRequiredas seen here.TLSRquiredis not honored.It would be really nice to have this option (command line/env var) to set the TLSRequired on/off at mailpit level.
@axllent commented on GitHub (Jan 26, 2024):
Thanks for your very detailed report @allesdavid, that's very helpful! Clearly you have more understanding than I do at this point of how this is expected to work, so maybe you can help clarify some things for me?
Currently Mailpit (more specifically smtpd) requires by default TLS for SMTP logins (
--smtp-auth-file) - although the TLS requirement can be optionally disabled using--smtp-auth-allow-insecure. This is obviously not the option you are referring to, as (I'm assuming) the difference is that withoutTLSRequireda client can optionally (and legally) send some other commands unencrypted if it chose to, just not the actual login part?If this is correct, are my following assumptions also correct:
To use
TLSRequired(I will refer to this option as--smtp-require-tls, although this doesn't exist yet):--smtp-auth-allow-insecure- so--smtp-require-tlscannot be combined with--smtp-auth-allow-insecure--smtp-require-tlsdoes not require authentication (--smtp-auth-file), ie: it can be used without authentication - it just requires full TLS encryption from the clientDo I understand this all correctly?
@allesdavid commented on GitHub (Jan 26, 2024):
Hi @axllent and thank you for your answer. Please find below some clarifications:
Yes, certificate and key must be provided
It's not so clear in the RFC but it wouldn't make sense otherwise. So yes, they should be mutually exclusive in my point of view.
Yes, that's right, it's just requiring TLS encryption from the beginning without implying a required authentication following the TLS handshake (from a RFC point of view).
https://www.ietf.org/rfc/rfc3207.txt#:~:text=4.1%20Processing%20After%20the%20STARTTLS%20Command
@axllent commented on GitHub (Jan 27, 2024):
@allesdavid This feature has now been released in v1.13.1. Please test and let me know if this works as you expected? Thanks.
@allesdavid commented on GitHub (Jan 29, 2024):
Hi @axllent thank you for your update, we will test it and let you know the results.
@allesdavid commented on GitHub (Jan 29, 2024):
Hi @axllent, I made some tests and it is working as expected.
I used those parameters:
Trying to auth without TLS before (v1.10):
Trying to auth without TLS now (v1.13.1):
Thank you, Im closing the issue.