Distributed James Server — Custom IMAP processing

James allows defining your own handler packages.

An Imap package is a simple class that bundles IMAP processing components:

public interface ImapPackage {
    Collection<ClassName> processors();

    Collection<ClassName> decoders();

    Collection<ClassName> encoders();
}

Processors needs to be of class AbstractProcessor, decoders of class AbstractImapCommandParser and encoders of class ImapResponseEncoder. Extensions-jar mechanism can be used to load custom classes.

Custom configuration can be obtained through ImapConfiguration class via the getCustomProperties method.

A full working example is available here.