INFO 14:41:51,912 | james.mailetcontext | Error communicating with spamd on localhost:783 Exception: java.net.ConnectException: Connection refused
Disabling SpamAssassin on James
TweetPosted on Friday Feb 06, 2015 at 03:00PM in Technology
I’m using revision number 1657019
in the SVN trunk of James3. I see an error in james-server.log
at every receiving of emails as follows:
It seems like that James is trying to connect to local SpamAssassin instance, but I have no SpamAssassin instance on my server yet so I simply deleted following definition from mailetcontainer.xml
.
<mailet notmatch="SenderHostIsLocal" class="SpamAssassin"> <spamdHost>localhost</spamdHost> <spamdPort>783</spamdPort> </mailet>
Now the exception disappeared.
Tags: james
Defining aliases on James
TweetPosted on Friday Feb 06, 2015 at 02:47PM in Technology
I’m using James3 in SVN trunk revision number 1657019
.
Adding a user to recipient rewrite table
This forwards a address postmaster@example.com
to kyle@example.com
:
./james-cli.sh -p 9999 -h localhost addaddressmapping postmaster example.com kyle@example.com
Defining postmaster address
James replaces a particular address postmaster
by PostmasterAlias
according to XML definition on some environment, so we need to set correct email address to it. in $JAMES_HOME/mailetcontainer.xml
as follows:
<mailetcontainer enableJmx="true"> <!-- MailAddress used for PostMaster --> <context> <postmaster>kyle@example.com</postmaster> </context> ...
Tags: james
Updating and Configuring Derby shipped with James
TweetPosted on Friday Feb 06, 2015 at 02:30PM in Technology
Put latest Derby jars
I used derby.jar
and derbynet.jar
of 10.11.1.1 to accept network connections. put these jars you needed into $JAMES_HOME/lib
.
Define that jars to wrapper.conf
Comment out following line in $JAMES_HOME/conf/wrapper.conf
:
#wrapper.java.classpath.94=%REPO_DIR%/derby-10.9.1.0.jar
Then put following line:
wrapper.java.classpath.94=%REPO_DIR%/derby.jar
Make Derby to accept network connections
Add following line to $JAMES_HOME/conf/wrapper.conf
.
wrapper.java.classpath.131=%REPO_DIR%/derbynet.jar
Also additional system properties are needed:
wrapper.java.additional.15=-Dderby.drda.startNetworkServer=true wrapper.java.additional.16=-Dderby.drda.portNumber=11527
Config derby.log
I prefer to place derby.log
into $JAMES_HOME/log
, and append log to exist one.
wrapper.java.additional.17=-Dderby.stream.error.file=../log/derby.log wrapper.java.additional.18=-Dderby.infolog.append=true
Define shutdown hook of Derby
Lob streaming is not supported
Currently OpenJPA, James’s JPA provider, is not supported lob streaming for Derby. James stored mail data in lob so If you frequently use larger mails, consider using other databases instead of Derby.
Profiling remote JVM over SSH with VisualVM
TweetPosted on Friday Feb 06, 2015 at 01:31PM in Technology
UPDATE October 2015: This procedure requires a VisualVM distribution that can be obtained from https://visualvm.java.net . At least, It will work with VisualVM 1.3.8. May doesn’t work with VisualVM which has been installed as a part of JDK distribution. I have experienced VisualVM which comes with JDK8u60 doesn’t work.
First I tried that creating a tunnel like ssh remote.example.org -L 19999:localhost:9999
and connecting VisualVM to localhost:19999
, but it didn’t worked. intead, creating a socks tunnel like ssh remote.example.com -D 1080
and connecting VisualVM to localhost:9999
via socks proxy is worked. detailed procedure is following:
-
Create ssh socks tunnel
-
Set manual proxy in VisualVM’s preferences
-
Right-click
Local
-
Add JMX connection
-
Enter
localhost:9999
to text box -
Click
OK
-
Double-click newly added JMX icon
Make sure that destination JVM has started with following system properties:
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false
Remote debugging of standalone application with IntelliJ IDEA
TweetPosted on Friday Feb 06, 2015 at 11:08AM in Technology
Environment
-
IntelliJ IDEA 14.0.3
-
Oracle JDK 8u20
-
OS X 10.9
Procedure
-
Open/create/import a project of the target application in IntelliJ IDEA
-
Attach additional sources such as dependencies if you need it. it can be attached from
Project Structure ⇒ Libraries
. -
Set breakpoints as you desired
-
Open
Edit Configurations…
-
Click
+
button -
Click
Remote
-
Look
Configuration
tab and copy the fragment inCommand line arguments for running remote JVM
as follows:-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
-
Click
OK
-
Launch target application with preceding argument which copied
-
Click insect icon on upper-right