Hi Mark,

I'm surprised nobody gave you the link to the how-to customize mail processing in the official doc, but should greatly help I believe (which is based on the example linked by Benoit, but with a step-by-step guide): https://james.apache.org/howTo/mail-processing.html

Also to know if your mailet was loaded correctly or not... did you add it in the mailet processing (aka mailetcontainer.xml file)? If you try to add your custom mailet in your pipeline, if James didn't load it and then find it, it would just throw at startup. If you added it in the pipeline and your server starts, it's likely that it loaded successfully I believe.

Rene.

On 01/09/2023 02:20, mARK aNDREWS wrote:
HI All,

Me again.  Thanks, Benoit, for your response.   I finally managed to get some time to set up an eclipse project and build a custom mailet, I just wanted to start with a simple mailet that would log some details of the incoming emails so that I can make sure the deployment is sound.  Sadly I don;t see the mailet loading, but I do see it on the classpath.

I am running this on linux, using docker for the James server.  I have attached the custom-mailet jar file I have built, and the logs I have taken from the server.  Based on what I have seen, the standard build of James uses SLF4J, but I can create a custom logger if I were to use log4j, the docker container does not have a log4j config, but rather seems to use logback, due to using it in a cluster.  SO not really sure how I can get my mailet logging on the container.

Also, the log file seems to load my custom jar, but I don;t ever see the registration of the matcher and my mailet class, so not sure it's actually loading.

Any hints or tips on where to go would be greatly appreciated.

link to jar file: https://drive.google.com/file/d/1QcYf3_LhIjyslFTlfJCHQDjuzp085vWq/view?usp=sharing <https://drive.google.com/file/d/1QcYf3_LhIjyslFTlfJCHQDjuzp085vWq/view?usp=sharing> (Google doesn't like jars_

Kind Regards

Mark


On Tue, 22 Aug 2023 at 15:38, Benoit TELLIER <btell...@linagora.com <mailto:btell...@linagora.com>> wrote:

    https://github.com/apache/james-project/tree/master/examples/custom-mailets 
<https://github.com/apache/james-project/tree/master/examples/custom-mailets> 
is likely the best place to start.


    Nice to see your enthousiasm!

    --


    Best regards,



    Benoit TELLIER



    General manager of Linagora VIETNAM.

    Product owner for Team-Mail product.

    Chairman of the Apache James project.



    Mail: btell...@linagora.com <mailto:btell...@linagora.com>

    Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal)


    On Aug 22, 2023 6:24 PM, from Mark Andrews Hi All,

    I have an interesting problem that I am trying to resolve, that
    requires me
    to write custom code to catch emails sent to an SMTP server, and then
    process them.

    I have many years of Java experience and came across Apache James as a
    possible way to achieve this.

    I guess after looking at all the documentation and reading through the
    site, what I am left asking myself is 'How do I build a mailet to do
    what I
    want, from scratch, as a Proof of Concept in the first instance, and
    then
    how do I develop it into a final solution.

    If anyone can point me in the right direction for this, I am more than
    happy to write a blog article, or post detailing the process so that
    it can
    be added to the Apache James site.

    Kind regards

    Mark Andrews
    Solutions Architect | Internet Solutions
    mobile:  +44 7747035866 <+44+7747035866>
    address:  Chichester, West Sussex



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org

Reply via email to