prosgarz35 opened a new pull request, #3214:
URL: https://github.com/apache/james-project/pull/3214

   ## Problem
   1. **Divergent HELO and EHLO validation**: `HeloCmdHandler` used legacy 
validation logic that rejected valid RFC 1123/5321 identifiers accepted by 
`EhloCmdHandler` (such as hostnames with numeric label prefixes like 
`mx-ll-110-164-x-x.2s1n` or opaque/MAC identifiers). It also logged `Invalid 
EHLO` instead of `Invalid HELO`.
   2. **DNS check bypass on transaction reset**: `ResolvableEhloHeloHandler` 
stored the `BAD_EHLO_HELO` flag in `State.Transaction`. When an unresolvable 
HELO/EHLO was rejected during `MAIL`, a transaction reset (`RSET` or subsequent 
transaction) cleared the flag, allowing subsequent `MAIL` commands on the same 
connection to proceed without a valid HELO.
   
   ## Solution
   - **Consistent validation (DRY)**: Delegate `HeloCmdHandler` argument 
validation to `EhloCmdHandler.isValid()` and fix the log message typo.
   - **Connection-scoped check**: Store `BAD_EHLO_HELO` in `State.Connection` 
so the rejection persists across resets until a valid HELO/EHLO command is 
issued.
   - **Tests**:
     - Added test case for domains with numeric prefixes in `SMTPServerTest`.
     - Added regression test in `ResolvableEhloHeloHandlerTest` ensuring bad 
HELO persists across resets and is cleared upon receiving a valid HELO.
     - Hardened multi-transaction test in `SMTPServerTest` to assert queue size 
and message subject.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to