quantranhong1999 commented on code in PR #1824:
URL: https://github.com/apache/james-project/pull/1824#discussion_r1435951710
##########
third-party/crowdsec/src/main/java/org/apache/james/CrowdsecImapConnectionCheck.java:
##########
@@ -41,7 +41,7 @@ public
CrowdsecImapConnectionCheck(CrowdsecClientConfiguration crowdsecClientCon
@Override
public Publisher<Void> validate(InetSocketAddress remoteAddress) {
- String ip = remoteAddress.getAddress().getHostAddress();
+ String ip = remoteAddress.getHostName();
Review Comment:
Q: Are they the same?
##########
server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/HAProxyMessageHandler.java:
##########
@@ -68,8 +68,8 @@ public void channelRead(ChannelHandlerContext ctx, Object
msg) throws Exception
LOGGER.info("Connection from {} runs through {} proxy",
haproxyMsg.sourceAddress(), haproxyMsg.destinationAddress());
// Refresh MDC info to account for proxying
MDCBuilder boundMDC = IMAPMDCContext.boundMDC(ctx);
+ Flux.fromIterable(connectionChecks).concatMap(connectionCheck
->
connectionCheck.validate(InetSocketAddress.createUnresolved(haproxyMsg.sourceAddress(),
haproxyMsg.sourcePort()))).then().block();
Review Comment:
Why not just `InetSocketAddress abcxyz = new
InetSocketAddress(haproxyMsg.sourceAddress(), haproxyMsg.sourcePort())` and
reuse it above also to recalculate the variable again?
##########
examples/proxy-smtp/logback.xml:
##########
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
Review Comment:
Why?
--
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]