You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2025/05/06 03:47:32 UTC
(james-project) branch master updated: [FIX] Carry over proxy info in IMAP channel description to allow audit in live connection origin
This is an automated email from the ASF dual-hosted git repository.
rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new 29d3343b0c [FIX] Carry over proxy info in IMAP channel description to allow audit in live connection origin
29d3343b0c is described below
commit 29d3343b0cbae93c7af8c7111ec3bf7f09cd9e26
Author: Benoit TELLIER <bt...@linagora.com>
AuthorDate: Mon May 5 23:49:11 2025 +0200
[FIX] Carry over proxy info in IMAP channel description to allow audit in live connection origin
---
.../main/java/org/apache/james/imapserver/netty/IMAPServer.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
index c76b826d75..115ea2dd08 100644
--- a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
+++ b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
@@ -18,6 +18,8 @@
****************************************************************/
package org.apache.james.imapserver.netty;
+import static org.apache.james.imapserver.netty.HAProxyMessageHandler.PROXY_INFO;
+
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.SocketAddress;
@@ -394,7 +396,10 @@ public class IMAPServer extends AbstractConfigurableAsyncServer implements ImapC
return new ConnectionDescription(
"IMAP",
jmxName,
- Optional.ofNullable(channel.remoteAddress()).map(this::addressAsString),
+ Optional.ofNullable(channel.attr(PROXY_INFO)).flatMap(attr -> Optional.ofNullable(attr.get()))
+ .map(proxyInfo -> (SocketAddress) proxyInfo.getSource())
+ .or(() -> Optional.ofNullable(channel.remoteAddress()))
+ .map(this::addressAsString),
Optional.ofNullable(channel.attr(CONNECTION_DATE)).flatMap(attribute -> Optional.ofNullable(attribute.get())),
channel.isActive(),
channel.isOpen(),
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org