Repository navigation
SMTP: Consistently validate HELO and scope BAD_EHLO_HELO to connection - #3214
Conversation
chibenwa
left a comment
There was a problem hiding this comment.
Wonderful, thanks for opening this one.
State is minimal, tests are there. I'll let it open few days for others to have a look.
If some other SMTP bugs are found please favor separate PRs.
Very good catch: +1 I was aware of this bug, but got faced to it in a context where I lacked the time to handle it then forgot. That's a nitpick because HELO is pretty much unused now but I fully agree the allignmenet is desirable.
Nice catch. |
you make me blush :) i try to find more not too much big but userful problems, i just dont have unlimited ai resources :) |
|
I also like this PR! Maybe squash your commits and let a maintainer restart the pipeline (I do not think the failure is related to your changes). |
i am also read logs and cant understand why it failed checks |
|
find error to failed build in jenkins pom.xml 3950 line -javaagent:"${settings.localRepository}"/org/jacoco/org.jacoco.agent/${jacoco-maven-plugin.version}/org.jacoco.agent-${jacoco-maven-plugin.version}-runtime.jar=destfile=${basedir}/target/jacoco.exec:${org.mockito:mockito-core:jar} THIS :${org.mockito:mockito-core:jar} makes error |
You are a maintainer now @felixauringer ! You can use your ASF login => https://id.apache.org/ |
Arsnael
left a comment
There was a problem hiding this comment.
LGTM. i did restart the build, the error was unerelated IMO
|
Can i ask for help why it not build? |
|
Once again, Jenkins is managed by the Apache infra team (not us^^), and like any platforms, sometimes there is issues, or sometimes when they do updates too they for example tell their workers to not take any new job until the ones currently running finish before restarting the platform. So yes it's not always building right off. Patience is appreciated here :) I saw your build ran in the end. I restarted it though as the error was unrelated to your PR. Hope it helps! |
thank you Rene <3 |
|
Hello @prosgarz35 Thanks a lot for those cool fixes. Cheers, Benoit |
Problem
HeloCmdHandlerused legacy validation logic that rejected valid RFC 1123/5321 identifiers accepted byEhloCmdHandler(such as hostnames with numeric label prefixes likemx-ll-110-164-x-x.2s1nor opaque/MAC identifiers). It also loggedInvalid EHLOinstead ofInvalid HELO.ResolvableEhloHeloHandlerstored theBAD_EHLO_HELOflag inState.Transaction. When an unresolvable HELO/EHLO was rejected duringMAIL, a transaction reset (RSETor subsequent transaction) cleared the flag, allowing subsequentMAILcommands on the same connection to proceed without a valid HELO.Solution
HeloCmdHandlerargument validation toEhloCmdHandler.isValid()and fix the log message typo.BAD_EHLO_HELOinState.Connectionso the rejection persists across resets until a valid HELO/EHLO command is issued.SMTPServerTest.ResolvableEhloHeloHandlerTestensuring bad HELO persists across resets and is cleared upon receiving a valid HELO.SMTPServerTestto assert queue size and message subject.