TheFunk
TheFunk

Reputation: 1098

Modify embedded Apache James Classloader to allow for custom hooks in same project

I am attempting to run my own custom in-memory James assembly inside of a Quarkus web application. I've been following along with the example here and gotten the server to run.

One of the issues I'm running into is that according to the docs I need to include custom hooks inside of a Jar file in a /conf/lib directory however I wish to use classes directly from inside the same project James is embedded in. Is there a way to modify the classloader so that I can use hooks that exist in the same jar where James is going to exist?

Edit: Adding handlerchain config. Sorry VonC I might have accidentally submitted this as an edit to your answer. It's been a day!

        <handlerchain>
            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
            <handler class="tech.gmork.oxprox.control.hooks.CustomAuthHook"/>
            <handler class="tech.gmork.oxprox.control.hooks.CustomMessageHook"/>
        </handlerchain>

Upvotes: 3

Views: 167

Answers (0)

Related Questions