Re: Understanding the Protocols API

Benoit TELLIER <[email protected]> Thu, 7 May 2026 14:29:36 +0000
Newsgroups gmane.comp.jakarta.james.devel
Message-ID <[email protected]>
Hello Felix

One of the key point that brings in complexity is the fact that protocol/api do not define network bindings as protocols (try to be) transport neutral, letting people write other transport layer than the Netty one.
If we wishes to simplify things I would start by challenging this.

1. Yes. That's historical (before I started being involved on the project).
Replacing NettyServer user by SMTPServer / POP3Server / LMTPServer would seem like a great move to me.


2. Correct also now IMAP have a different internal architecture that differenciate parsing / processing / encoding that is waaaay more sain than the logic of the protocol layer where the handler does everything.
IMO a first step would be to evolve the protocol layer to that decode - process - encode model
Then we could think about convergence.

Another point is that protocol wiring is needlessly complex and reinvent a dependency injection system.
It was likely written at a time dependency Injection was not a common thing and remained...
While the IMAP layer is very DI friendly.

Alast all those evolution are desirable-but-time-consuming evolution and the convergence would bring breaking changes to users as protocol / imap customization depends on the internal abstractions.

I bet nobody dared fighting that monster...

Does this answer your question ?-- 

Best regards,

Benoit TELLIER

General manager of Linagora VIETNAM.
Product owner for Twake-Mail product.
Chairman of the Apache James project.

Mail: [email protected]
Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal)


On May 7, 2026 3:51 PM, from Felix Auringer <[email protected]>Dear developer community,

I have been looking through the codebase to find out the exact behavior of some configuration options.
While I have found what I was looking for, I got slightly confused by the protocols API architecture and hope that somebody can clarify some things for me.
This is the type hierarchy:

ProtocolServer: basic interface for binding a server
  AbstractAsyncServer: abstract implementation of ProtocolServer using netty
    AbstractConfigurableAsyncServer: abstract subclass of AbstractAsyncServer with common configuration like TLS, proxy, ...
      IMAPServer: concrete subclass of AbstractConfigurableAsyncServer, implements IMAPServerMBean
      ManageSieveServer: concrete subclass of AbstractConfigurableAsyncServer, implements ManageSieveServerMBean
      AbstractProtocolAsyncServer: abstract subclass of AbstractConfigurableAsyncServer, allows to set protocol handlers
        LMTPServer: concrete subclass of AbstractProtocolAsyncServer, implements LMTPServerMBean
        POP3Server: concrete subclass of AbstractProtocolAsyncServer, implements POP3ServerMBean
        SMTPServer: concrete subclass of AbstractProtocolAsyncServer, implements SMTPServerMBean
    NettyServer: concrete subclass of AbstractAsyncServer

I have two main questions:
1. What is the NettyServer used for? It seems to be only used for tests but never in real code.
2. Why do IMAP and ManageSieve not fulfill the protocols API (they have no subclass of ProtocolImpl)? They consequently need their own implementations for session, handler chain, ...

Best regards,
Felix
---
Gesellschaft für interkulturelles
Zusammenleben gGmbH (GIZ)
Felix Auringer
IT
Reformationsplatz 2
13597 Berlin

Tel: 030/513 0100 00; Fax: 030/513 0100 09 
giz.berlin; [email protected]

Amtsgericht Charlottenburg HRB 200872 B
Geschäftsführerin: Dr. Britta Marschke

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