Hiya Matt, 

Firstly sorry about the mail format, last time I don’t know how to remove or 
any idea to remove CSS Format so for this time im gonna convert them into .txt 
file copy paste it, I gonna use dropbox to share the java file then.
https://www.dropbox.com/s/d4x2rtjh14u6ebw/CustomMeiletTest.java?dl=0 – 
CustomMeiletTest.java

about the Log4j, so that means I can only use one either : 
“log4j.logger.com.test=INFO, CONS, FILE” or “log4j.logger.com.test=DEBUG, CONS, 
FILE” ?

I try to comment one of the line and test it for both of them, but still 
nothing works.  I guess it doesn’t work because I didn’t fill in any function 
inside the overridden function maybe? Im still trying to understand what does 
“Level” means. From what I understand, the “Level” mentioned here (DEBUG,INFO) 
means what category is the message displayed.

For the James error, im putting the log error in Txt File also it doesn’t bulk 
the mail with TextWall
https://www.dropbox.com/s/gkfv06o1zixfuf4/JamesErrorLog.log?dl=0 – James Error 
log that I separated from the main james-server.log, the error message inside 
the JamesErrorLog.log text are repeated multiple time in the james-server.log, 
so I just copy paste one pattern of it.

The Mail header thing confuses me as I was using my yahoo ID so I don’t know 
anything about the setting (or maybe I get the wrong idea about it)

I hope all of these information cleared up the confusion from the last message. 
Meanwhile I gonna try to mess around with the setting and try to reset to 
default for the mailet to see where the error comes from.

Sorry for any wrong word, and thank you for the help.

Sincerely, Jason



Sent from Mail for Windows 10

From: cryptearth
Sent: Thursday, July 4, 2019 11:20 AM
To: server-user@james.apache.org
Subject: Re: About Custom Mailet Configuration

Hey Jason,

it seems you either didn't attached the source or don't have permission 
to (idk - maybe a list admin could help about this).
So, either you use services like pastebin, an online repo, host it on a 
server - or for achive purpose post it here in the mail list.

About your log4j: only add one line, either info or debug - depend on 
how deep you need. Finer levels like debug include higher levels like info.
As for exceptions: always print the whole stacktrace - the bit you 
posted only says the nested reason is a NPE - but not if it's the main 
issue or if there're any other issues. And please try to post it as 
TEXTMODE mail excluding those fancy CSS crap - it makes it hard to read 
on different devices.

As I've scanned the header you send from jasonxc...@yahoo.com.INVALID - 
this doesn't seem right - please check your mail client config. This 
could be a reason why your attachements didn't come through.

Matt

Am 04.07.2019 um 05:34 schrieb Jason Tjankilisan:
>
> Hi
>
> So I was reading this tutorial about creating your own custom Mailet 
> https://james.apache.org/server/3/dev-extend-mailet.html, and from 
> what i have read, Mailet is a component that process the mail that is 
> going through the server and can output log whenever something happen 
> with the Email. Im interested in trying this tutorial to understand 
> better of mailet works.
>
> So I follow the tutorial, but I had trouble understanding the tutorial 
> from the lack imagery. Here’s what I’ve done so far
>
>   * Create a java file just like in the “Logging” and add Init ,
>     Destroy, getMailetInfo function as the “Configuration” said they
>     must have that.
>   * Unzip the james-server-mailets-3.3.0.jar from james/lib to get the
>     function.
>   * Put all on it in one place and use Ant Compile (I didn’t know
>     anything about Apache Ant but my friend set it up for me and just
>     to type ant when I want to compile) to build it and created the
>     jar file from the custom mailet.
>   * Put the jar file into james/lib
>   * Edit the log4j.properties as mention in the code : added this
>   * # Experimental
>       o log4j.logger.com.test=INFO, CONS, FILE
>       o log4j.logger.com.test=DEBUG, CONS, FILE
>       o # ------------
>
>   * Edit the mailetcontainer.xml and comment out the one near that as
>     last time I tried it, the connection refused when both of those
>     are active.
>
> <!-- Send remaining mails to the transport processor for either local 
> or remote delivery -->
>
>        <mailet match="All" class="com.test.CustomMeiletTestClassName"/>
>
> <!--
>
>        <mailet match="All" class="ToProcessor">
>
> <processor>transport</processor>
>
>        </mailet>
>
> -->
>
> Some problem occur , the connection still refused and these error show 
> up at log whenever I use my CustomMeiletTest:
>
> INFO14:31:16,495| 
> org.apache.james.mailetcontainer.lib.AbstractStateMailetProcessor| 
> Mailet com.test.CustomMeiletTestinstantiated.
>
> WARN14:31:16,515| 
> org.apache.james.container.spring.context.JamesServerApplicationContext| 
> /Exception/encountered during context initialization - cancelling 
> refresh attempt: 
> /org.springframework.beans.factory.BeanCreationException/: 
> *Error*creating bean with name 'mailprocessor': Invocation of init 
> method failed; nested exception is /javax.mail.MessagingException/: 
> Unable to setup routing for MailetMatcherPairs;
>
> nested exception is:
>
> /java.lang.NullPointerException/
>
> I attach the java code since writing it here gonna make the mail look 
> so large. Can anyone help what did I do wrong or maybe misunderstand?
>
> Sorry for any wrong word, and thank you for the help.
>
> Sincerely, Jason
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for 
> Windows 10
>
>
> ---------------------------------------------------------------------
> 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