Re: MalformedURLException: unknown protocol: classpath SOLVED
Hello Marc, glad I could help. Yea, even James is good documented in it's source files, it takes time to dig around through the repo to discover what James is capable of. For example: composite matcher found in org.apache.james.mailetcontainer.impl.matchers in james-project/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/matchers - found it just by accident. May it will help me for my issue - but could had been easier if it would been mentoined somewhere. Also: I didn't yet found a way to use maven to generate docs (maybe there is?) so one could get a better around to learn the structure james is build. Maybe I'll figure some out with doc-tool. So long for now, Matt Am 22.02.2019 um 05:21 schrieb Marc Chamberlin: Matt - We have GOT to get these great answers of yours included as part of the documentation on the website! You put a lot of time, thought, and effort in composing them and is would be a shame to lose it! I actually am running the Apache HTTP webserver on my server also, so I use it to handle the verification/validation of LetsEncrypt certificates, along with a cron job to periodically renew them. Seems to be working OK for James as well.. Marc On 02/20/2019 01:23 PM, cryptearth wrote: Hey Marc, glad to hear to great news. After your explanation I know can understand your hassle. As said, for me james is just running fully external on my root-server at OVH - and my backup is really just for receiving when I bring down my root for maintanance (weekly security updates). That's why I never encountered the very issues you speaking about. Guess that's what you have to deal with when you use james in an office / corporate network where james is running on the main server (or maybe even on another machine just communicating over the main-router/-server). I've started using Citadel/UX - but they dropped support for SuSE at some point so I just needed an easy to use replacement as I still can't get other main MTAs like postfix, sendmail, exim, others - to work properly. Most promising was once a try with a tutorial specific written for then-up-to-date versions for I think it was back for 13.1 or so with postfix and postfix-admin - but I also failed with this step-by-step guide. Also, what no-other MTA than james could offer me is one thing: not only using database for user management - but also for mail storage. This way I can easy backup by a database dump. I fully aggree with you on the mentioned matcher/mailet vs smtp-auth - espacially as it is mentioned in the doc itsefl. Also the "master-override" might be useful - for what ever odd reason. So, let's get started with let's encrypt then: This is what I use the get a new certificate: import org.shredzone.acme4j.Session; import java.security.KeyPair; import org.shredzone.acme4j.util.KeyPairUtils; import java.io.FileReader; import org.shredzone.acme4j.Account; import org.shredzone.acme4j.AccountBuilder; import java.net.URL; import org.shredzone.acme4j.Login; import org.shredzone.acme4j.Account; import org.shredzone.acme4j.Order; import org.shredzone.acme4j.Authorization; import org.shredzone.acme4j.challenge.Dns01Challenge; import org.shredzone.acme4j.Status; import org.shredzone.acme4j.util.CSRBuilder; import org.shredzone.acme4j.Certificate; import java.io.FileWriter; public final class Acme { public final static void main(final String... args) throws Exception { Session session=new Session("acme://letsencrypt.org"); KeyPair accountKeyPair=KeyPairUtils.readKeyPair(new FileReader("account-openssl.key")); Account account=(new AccountBuilder()).onlyExisting().useKeyPair(accountKeyPair).create(session); URL accountLocationUrl=account.getLocation(); Login login=session.login(accountLocationUrl, accountKeyPair); Order order=account.newOrder().domains("cryptearth.de", "*.cryptearth.de").create(); for(Authorization auth : order.getAuthorizations()) processAuth(auth); KeyPair domainKeyPair=KeyPairUtils.readKeyPair(new FileReader("server-openssl.key")); CSRBuilder csrBuilder=new CSRBuilder(); csrBuilder.addDomain("cryptearth.de"); csrBuilder.addDomain("*.cryptearth.de"); csrBuilder.sign(domainKeyPair); order.execute(csrBuilder.getEncoded()); while(order.getStatus()!=Status.VALID) { System.out.println(order.getStatus()); if(order.getStatus()==Status.INVALID) throw new RuntimeException("invalid"); Thread.sleep(3000L); order.update(); } System.out.println(order.getStatus()); Certificate
Re: MalformedURLException: unknown protocol: classpath SOLVED
Matt - We have GOT to get these great answers of yours included as part of the documentation on the website! You put a lot of time, thought, and effort in composing them and is would be a shame to lose it! I actually am running the Apache HTTP webserver on my server also, so I use it to handle the verification/validation of LetsEncrypt certificates, along with a cron job to periodically renew them. Seems to be working OK for James as well.. Marc On 02/20/2019 01:23 PM, cryptearth wrote: > Hey Marc, > > glad to hear to great news. > > After your explanation I know can understand your hassle. As said, for > me james is just running fully external on my root-server at OVH - and > my backup is really just for receiving when I bring down my root for > maintanance (weekly security updates). That's why I never encountered > the very issues you speaking about. Guess that's what you have to deal > with when you use james in an office / corporate network where james > is running on the main server (or maybe even on another machine just > communicating over the main-router/-server). > > I've started using Citadel/UX - but they dropped support for SuSE at > some point so I just needed an easy to use replacement as I still > can't get other main MTAs like postfix, sendmail, exim, others - to > work properly. Most promising was once a try with a tutorial specific > written for then-up-to-date versions for I think it was back for 13.1 > or so with postfix and postfix-admin - but I also failed with this > step-by-step guide. Also, what no-other MTA than james could offer me > is one thing: not only using database for user management - but also > for mail storage. This way I can easy backup by a database dump. > > I fully aggree with you on the mentioned matcher/mailet vs smtp-auth - > espacially as it is mentioned in the doc itsefl. Also the > "master-override" might be useful - for what ever odd reason. > > So, let's get started with let's encrypt then: > > This is what I use the get a new certificate: > > import org.shredzone.acme4j.Session; > import java.security.KeyPair; > import org.shredzone.acme4j.util.KeyPairUtils; > import java.io.FileReader; > import org.shredzone.acme4j.Account; > import org.shredzone.acme4j.AccountBuilder; > import java.net.URL; > import org.shredzone.acme4j.Login; > import org.shredzone.acme4j.Account; > import org.shredzone.acme4j.Order; > import org.shredzone.acme4j.Authorization; > import org.shredzone.acme4j.challenge.Dns01Challenge; > import org.shredzone.acme4j.Status; > import org.shredzone.acme4j.util.CSRBuilder; > import org.shredzone.acme4j.Certificate; > import java.io.FileWriter; > public final class Acme > { > public final static void main(final String... args) throws > Exception > { > Session session=new Session("acme://letsencrypt.org"); > KeyPair accountKeyPair=KeyPairUtils.readKeyPair(new > FileReader("account-openssl.key")); > Account account=(new > AccountBuilder()).onlyExisting().useKeyPair(accountKeyPair).create(session); > URL accountLocationUrl=account.getLocation(); > Login login=session.login(accountLocationUrl, > accountKeyPair); > Order > order=account.newOrder().domains("cryptearth.de", > "*.cryptearth.de").create(); > for(Authorization auth : order.getAuthorizations()) > processAuth(auth); > KeyPair domainKeyPair=KeyPairUtils.readKeyPair(new > FileReader("server-openssl.key")); > CSRBuilder csrBuilder=new CSRBuilder(); > csrBuilder.addDomain("cryptearth.de"); > csrBuilder.addDomain("*.cryptearth.de"); > csrBuilder.sign(domainKeyPair); > order.execute(csrBuilder.getEncoded()); > while(order.getStatus()!=Status.VALID) > { > System.out.println(order.getStatus()); > if(order.getStatus()==Status.INVALID) > throw new RuntimeException("invalid"); > Thread.sleep(3000L); > order.update(); > } > System.out.println(order.getStatus()); > Certificate certificate=order.getCertificate(); > System.out.println(certificate.getLocation()); > FileWriter fileWriter=new FileWriter("chain.crt"); > certificate.writeCertificate(fileWriter); > fileWriter.flush(); > fileWriter.close(); > } > private final static void processAuth(Authorization auth) > throws Exception > { > Dns01Challenge > challenge=auth.findChallenge(Dns01Challenge.TYPE); > System.out.println(auth.getDomain()); > System.out.println(challenge.getDigest()); > System.in.read(); >
Re: MalformedURLException: unknown protocol: classpath SOLVED
Hi Matt - We need you to put all your wonderful replies and commentary up on the James website as part of the documentation. Some of the stuff there is pretty sparse and you are doing a great job of explaining things! ;-) I will intersperse a few comments below - On 02/20/2019 09:50 AM, cryptearth wrote: > Evening all, Matt here. > > Marc, let's look at the doc: > > "This is an anti-relay matcher/mailet combination > > Emails sent from servers not in the network list are rejected as spam. > This is one method of preventing your server from being used as an > open relay. Make sure you understand how to prevent your server from > becoming an open relay before changing this configuration. See > alsoin SMTP Server > > This matcher/mailet combination must come after local delivery has > been performed. Otherwise local users will not be able to receive > email from senders not in this remote address list. > > If you are using this matcher/mailet you will probably want to update > the configuration to include your own network/addresses. The matcher > can be configured with a comma separated list of IP addresses > wildcarded IP subnets, and wildcarded hostname subnets. > e.g. "RemoteAddrNotInNetwork=127.0.0.1, abc.de.*, 192.168.0.*" Understood. This is a perfectly valid approach to cutting down on spam being sent through a James server.. It would be interesting to know if this is the most commonly used approach, or whether most servers are using SMTP authentication instead, or whether most servers are using both methods. My argument is not against using this particular matcher/mailet, but that the default configuration files should come supplied and set up in a way that reflects the most common usage. To restrict emails to only come from users on the local host, by default in the supplied config file, seems to be awfully restrictive and uncommon usage, but I am only guessing. My suspicion is that most folks using James are going to use SMTP authentication, at least that is my own personal experience, and for users to be on a LAN/WLAN. So I am wondering if this matcher/mailet should not be enabled by default and SMTP authentication should be enabled instead, by default. I understand the need for James to start up safely, from the default configurations, so as not to be an open relay by default. > > If you are using SMTP authentication then you can (and generally > should) disable this matcher/mailet pair." I think this relationship between using SMTP authentication and this matcher/mailet should be automated. In other words, if SMTP authentication is turned on then this matcher/mailet should be disabled by default automatically. And vice/versa. I also think that the administrator should be able to override this automated relationship, with an explicitly set option, if for some reason both or neither approaches are wanted. Again, the real question is, what is the most common way James is being configured, and how can mistakes, such as I made, be minimized. The goal being to keep James robust and easy to manage. > > So, as far as I understand it: "Don't touch it if you don't understand > it - but you should remove it anyway when smtp auth is used.". Guess > that's it for you. I took the "Don't touch it" approach as much as I could. Trouble is I didn't catch this somewhat hidden matcher/mailet nor did I expect that the James server would come up with a very restrictive policy that was preventing me from testing/using it from somewhere else on my LAN. Especially after I had enabled SMTP authentication, which kinda implied, at least to me, that I would be able to use James from across my LAN. This is re-enforce by the observation the IMAP and POP3 were working from across my LAN and made it difficult to understand why SMTP wouldn't. > > I've never encountered that as I only have my domain cryptearth.de in > domainlist - neither localhost nor other local entries. I've never > tried to send a mail to localhost - allthough, that's one part of my > own current thread about overwrite local service mails from > sendmail-nullclient used by apache and cron - but that's its own > topic. So still have this matcher/mailet in my config, allthough I > have smtp auth enabled. > > So, as far as I understood your reply, you now finally got james up > and running so you can also send mails to others? Yep! :-) And don't get me wrong, I am NOT complaining about Apache James really, just throwing out some thoughts to think about, which might make it easier for others following in my footsteps, in installing and bringing up James. I am very impressed with the amount of work that has obviously gone into developing James, and totally appreciate the amount of support you and Benoit have given me! I am going to work on getting SSL/TLS working with LetsEncrypt certificates next... Marc.. > > Matt > > > Am 20.02.2019 um 16:59 schrieb Marc Chamberlin: >> Morning Benoit ;-) This could get into being a philosophical discussion >>
Re: MalformedURLException: unknown protocol: classpath SOLVED
Evening all, Matt here. Marc, let's look at the doc: "This is an anti-relay matcher/mailet combination Emails sent from servers not in the network list are rejected as spam. This is one method of preventing your server from being used as an open relay. Make sure you understand how to prevent your server from becoming an open relay before changing this configuration. See alsoin SMTP Server This matcher/mailet combination must come after local delivery has been performed. Otherwise local users will not be able to receive email from senders not in this remote address list. If you are using this matcher/mailet you will probably want to update the configuration to include your own network/addresses. The matcher can be configured with a comma separated list of IP addresses wildcarded IP subnets, and wildcarded hostname subnets. e.g. "RemoteAddrNotInNetwork=127.0.0.1, abc.de.*, 192.168.0.*" If you are using SMTP authentication then you can (and generally should) disable this matcher/mailet pair." So, as far as I understand it: "Don't touch it if you don't understand it - but you should remove it anyway when smtp auth is used.". Guess that's it for you. I've never encountered that as I only have my domain cryptearth.de in domainlist - neither localhost nor other local entries. I've never tried to send a mail to localhost - allthough, that's one part of my own current thread about overwrite local service mails from sendmail-nullclient used by apache and cron - but that's its own topic. So still have this matcher/mailet in my config, allthough I have smtp auth enabled. So, as far as I understood your reply, you now finally got james up and running so you can also send mails to others? Matt Am 20.02.2019 um 16:59 schrieb Marc Chamberlin: Morning Benoit ;-) This could get into being a philosophical discussion for certain! I have mixed feelings about customization of error messages, and you are correct in saying I could change this particular one. I have always approached software design with the attitude that error handling and error messages should be carefully crafted so as to guide users to a solution, not just tell them that something went wrong. Which is what this particular error message is doing when left in it's current default state. We could change/customize it for our own users, (actually I will just remove this mailet) but doing so leads to a different issue. If everyone who installs James servers (or any other application for that matter) is allowed to customize error messages then it leads to a non-standard environment. Often, when users encounter an error message, that doesn't provide an understandable solution, they will then Google it looking for a solution, hoping to find a guru or a collective mind to provide one. Even in cases such as this, where the solution will require the assistance of the James administrators to solve this problem, the user needs to be told that he/she must contact them AND what exactly they need to tell the administrators. I would craft this message to say, "Your email server is rejecting your request to send your email messages. Please contact your Internet Service Provider and/or IT administrator and tell them that your email server is rejecting your request to relay email because it is not configured to accept email from your IP address. They need to check the configuration of the anti-relay matcher/mailet or remove this matcher/mailet from the server." In this way, both the user and the administrators have been guided to a solution making it easier to resolve this problem. I am not sure that I would design this matcher/mailet to allow easy customization of the error message however, I think that should be only done internally within the code itself. But you could convince me otherwise if you can provide me with some compelling reasons to allow customization. Marc On 02/20/2019 12:15 AM, Benoit Tellier wrote: Hi. This is very true. But the technical knowledge limitation is not the only one... There is also internationalization + text/plain messages... Note that "Bounce" mailet family allows a '' field allowing you to maybe further explain this to non techie users you might have to handle - and in the language of your choice, which is a big +. Cheers, Benoit On 2/20/19 12:02 PM, Marc Chamberlin wrote: Funny that I wasn't getting the notice "550 - Requested action not taken: relaying denied" in a bounce email... (but even that is a really bad error message that most users will not understand nor know what to do about it.) - 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:
Re: MalformedURLException: unknown protocol: classpath SOLVED
Morning Benoit ;-) This could get into being a philosophical discussion for certain! I have mixed feelings about customization of error messages, and you are correct in saying I could change this particular one. I have always approached software design with the attitude that error handling and error messages should be carefully crafted so as to guide users to a solution, not just tell them that something went wrong. Which is what this particular error message is doing when left in it's current default state. We could change/customize it for our own users, (actually I will just remove this mailet) but doing so leads to a different issue. If everyone who installs James servers (or any other application for that matter) is allowed to customize error messages then it leads to a non-standard environment. Often, when users encounter an error message, that doesn't provide an understandable solution, they will then Google it looking for a solution, hoping to find a guru or a collective mind to provide one. Even in cases such as this, where the solution will require the assistance of the James administrators to solve this problem, the user needs to be told that he/she must contact them AND what exactly they need to tell the administrators. I would craft this message to say, "Your email server is rejecting your request to send your email messages. Please contact your Internet Service Provider and/or IT administrator and tell them that your email server is rejecting your request to relay email because it is not configured to accept email from your IP address. They need to check the configuration of the anti-relay matcher/mailet or remove this matcher/mailet from the server." In this way, both the user and the administrators have been guided to a solution making it easier to resolve this problem. I am not sure that I would design this matcher/mailet to allow easy customization of the error message however, I think that should be only done internally within the code itself. But you could convince me otherwise if you can provide me with some compelling reasons to allow customization. Marc On 02/20/2019 12:15 AM, Benoit Tellier wrote: > Hi. > > This is very true. But the technical knowledge limitation is not the > only one... There is also internationalization + text/plain messages... > > Note that "Bounce" mailet family allows a '' field allowing you > to maybe further explain this to non techie users you might have to > handle - and in the language of your choice, which is a big +. > > Cheers, > > Benoit > > On 2/20/19 12:02 PM, Marc Chamberlin wrote: >> Funny that I wasn't getting the notice "550 - Requested action not >> taken: relaying denied" in a bounce email... (but even that is a really >> bad error message that most users will not understand nor know what to >> do about it.) > - > To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org > For additional commands, e-mail: server-user-h...@james.apache.org > -- Linux Counter
Re: MalformedURLException: unknown protocol: classpath SOLVED
Hi. This is very true. But the technical knowledge limitation is not the only one... There is also internationalization + text/plain messages... Note that "Bounce" mailet family allows a '' field allowing you to maybe further explain this to non techie users you might have to handle - and in the language of your choice, which is a big +. Cheers, Benoit On 2/20/19 12:02 PM, Marc Chamberlin wrote: > Funny that I wasn't getting the notice "550 - Requested action not > taken: relaying denied" in a bounce email... (but even that is a really > bad error message that most users will not understand nor know what to > do about it.) - To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org
Re: MalformedURLException: unknown protocol: classpath SOLVED
Well at this point I will say that the upgrade to James 3.4 SNAPSHOT has worked, I finally found the remaining problem that had been overlooked. (this is a rather bad user trap IMHO and probably should be re-addressed.) There is a mailet defined in the mailetcontainer.xml that needs to be removed, (commented out) - relay-denied 550 - Requested action not taken: relaying denied if one is going to enable SMTP authorization. Yeah there is a lot of comments that say as much, in that file, but this is easily overlooked IMHO. Would be safer to automate the removal of this mailet when SMTP authorization is enabled and then in the rare cases where this is also wanted, require the installer to opt in rather than having to opt out. Just a thought Anyways thanks everyone for all your help, I will now start to set up all the rest of my domains and users that I need to support and see how far I get... If I have more questions I will start a new thread... Funny that I wasn't getting the notice "550 - Requested action not taken: relaying denied" in a bounce email... (but even that is a really bad error message that most users will not understand nor know what to do about it.) Marc.. On 02/19/2019 06:57 PM, Marc Chamberlin wrote: > Oh well never mind this exception about localhost, my bad, I had added > localhost to the domainlist as an experiment and that was not a good > idea. Removing it cleared up this exception, but I still cannot send > anything out... Still looking for a solution... > > Marc... > -- Linux Counter
Re: MalformedURLException: unknown protocol: classpath
Oh well never mind this exception about localhost, my bad, I had added localhost to the domainlist as an experiment and that was not a good idea. Removing it cleared up this exception, but I still cannot send anything out... Still looking for a solution... Marc... On 02/19/2019 06:16 PM, Marc Chamberlin wrote: > Hi Matt, Geez thanks so much for taking the time to do such a wonderful > write up! And following your advice did solve the double entry into > Thunderbird's sent folder. I still cannot get James to send anything out > though but I am now getting messages written to the james-server.log > file and discovered the following stack exception is occurring. Doesn't > make sense to me why James is trying to do a DNS lookup on localhost, > but better eyes might grok this - > > INFO 17:39:38,418 | > org.apache.james.protocols.netty.BasicChannelUpstreamHandler | > Connection established from 192.168.10.10 > WARN 17:39:38,571 | org.apache.james.dnsservice.dnsjava.DNSJavaService > | Error determining result > java.lang.IllegalStateException: Lookup of localhost A isn't done > at org.xbill.DNS.Lookup.checkDone(Lookup.java:595) > at org.xbill.DNS.Lookup.getResult(Lookup.java:632) > at > org.apache.james.dnsservice.dnsjava.DNSJavaService.lookup(DNSJavaService.java:374) > at > org.apache.james.dnsservice.dnsjava.DNSJavaService.lookupNoException(DNSJavaService.java:396) > at > org.apache.james.dnsservice.dnsjava.DNSJavaService.getAllByName(DNSJavaService.java:484) > at > org.apache.james.domainlist.lib.AbstractDomainList.getDomainIpStream(AbstractDomainList.java:215) > at > org.apache.james.domainlist.lib.AbstractDomainList.lambda$getDomainsIpStream$1(AbstractDomainList.java:209) > at > java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267) > at java.util.Iterator.forEachRemaining(Iterator.java:116) > at > java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) > at > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) > at > java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) > at > java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) > at > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) > at > java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) > at > org.apache.james.domainlist.lib.AbstractDomainList.detectIps(AbstractDomainList.java:178) > at > org.apache.james.domainlist.lib.AbstractDomainList.getDomains(AbstractDomainList.java:163) > at > org.apache.james.domainlist.lib.AbstractDomainList.containsDomain(AbstractDomainList.java:151) > at > org.apache.james.smtpserver.fastfail.ValidRcptHandler.isLocalDomain(ValidRcptHandler.java:101) > at > org.apache.james.protocols.smtp.core.fastfail.AbstractValidRcptHandler.doRcpt(AbstractValidRcptHandler.java:42) > at > org.apache.james.protocols.smtp.core.RcptCmdHandler.callHook(RcptCmdHandler.java:234) > at > org.apache.james.protocols.smtp.core.RcptCmdHandler.callHook(RcptCmdHandler.java:51) > at > org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler.processHooks(AbstractHookableCmdHandler.java:116) > at > org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler.onCommand(AbstractHookableCmdHandler.java:77) > at > org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler.onCommand(AbstractHookableCmdHandler.java:52) > at > org.apache.james.protocols.api.handler.CommandDispatcher.dispatchCommandHandlers(CommandDispatcher.java:179) > at > org.apache.james.protocols.api.handler.CommandDispatcher.onLine(CommandDispatcher.java:157) > at > org.apache.james.protocols.netty.BasicChannelUpstreamHandler.messageReceived(BasicChannelUpstreamHandler.java:155) > at > org.apache.james.smtpserver.netty.SMTPChannelUpstreamHandler.messageReceived(SMTPChannelUpstreamHandler.java:60) > at > org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) > at > org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) > at > org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) > at > org.jboss.netty.channel.SimpleChannelUpstreamHandler.messageReceived(SimpleChannelUpstreamHandler.java:124) > at > org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) > at > org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) > at > org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) > at >
Re: MalformedURLException: unknown protocol: classpath
Hi Matt, Geez thanks so much for taking the time to do such a wonderful write up! And following your advice did solve the double entry into Thunderbird's sent folder. I still cannot get James to send anything out though but I am now getting messages written to the james-server.log file and discovered the following stack exception is occurring. Doesn't make sense to me why James is trying to do a DNS lookup on localhost, but better eyes might grok this - INFO 17:39:38,418 | org.apache.james.protocols.netty.BasicChannelUpstreamHandler | Connection established from 192.168.10.10 WARN 17:39:38,571 | org.apache.james.dnsservice.dnsjava.DNSJavaService | Error determining result java.lang.IllegalStateException: Lookup of localhost A isn't done at org.xbill.DNS.Lookup.checkDone(Lookup.java:595) at org.xbill.DNS.Lookup.getResult(Lookup.java:632) at org.apache.james.dnsservice.dnsjava.DNSJavaService.lookup(DNSJavaService.java:374) at org.apache.james.dnsservice.dnsjava.DNSJavaService.lookupNoException(DNSJavaService.java:396) at org.apache.james.dnsservice.dnsjava.DNSJavaService.getAllByName(DNSJavaService.java:484) at org.apache.james.domainlist.lib.AbstractDomainList.getDomainIpStream(AbstractDomainList.java:215) at org.apache.james.domainlist.lib.AbstractDomainList.lambda$getDomainsIpStream$1(AbstractDomainList.java:209) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.apache.james.domainlist.lib.AbstractDomainList.detectIps(AbstractDomainList.java:178) at org.apache.james.domainlist.lib.AbstractDomainList.getDomains(AbstractDomainList.java:163) at org.apache.james.domainlist.lib.AbstractDomainList.containsDomain(AbstractDomainList.java:151) at org.apache.james.smtpserver.fastfail.ValidRcptHandler.isLocalDomain(ValidRcptHandler.java:101) at org.apache.james.protocols.smtp.core.fastfail.AbstractValidRcptHandler.doRcpt(AbstractValidRcptHandler.java:42) at org.apache.james.protocols.smtp.core.RcptCmdHandler.callHook(RcptCmdHandler.java:234) at org.apache.james.protocols.smtp.core.RcptCmdHandler.callHook(RcptCmdHandler.java:51) at org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler.processHooks(AbstractHookableCmdHandler.java:116) at org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler.onCommand(AbstractHookableCmdHandler.java:77) at org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler.onCommand(AbstractHookableCmdHandler.java:52) at org.apache.james.protocols.api.handler.CommandDispatcher.dispatchCommandHandlers(CommandDispatcher.java:179) at org.apache.james.protocols.api.handler.CommandDispatcher.onLine(CommandDispatcher.java:157) at org.apache.james.protocols.netty.BasicChannelUpstreamHandler.messageReceived(BasicChannelUpstreamHandler.java:155) at org.apache.james.smtpserver.netty.SMTPChannelUpstreamHandler.messageReceived(SMTPChannelUpstreamHandler.java:60) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.messageReceived(SimpleChannelUpstreamHandler.java:124) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43) at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67) at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at
Re: MalformedURLException: unknown protocol: classpath
Hi Matt, Thank you very much for this very nice explanation! For me long mails are perfectly fine on a mailing list, and better suited than small parts. Thanks again for sharing. Regards, Raphaël. Le 2019-02-19 19:13, cryptearth a écrit : Hey Marc, ah, I can see a lot of myself in you back when I used james first back in 2015 or so ... maybe I can help you out on some questions as I also learned a bit since then. But, if I fell, Benoit is one kind of a crack on james and, as far as I remember for my questions, always has some neat trick handy. I think he is glad to help another new user to join this awesome project. First, let me get on this "sent messages shows up twice in sent folder"-thing, as it took me ages to figure it out: To keep it short: it some wired issue when using thunderbird with james A bit more explain: IMAP is not only capable of downloading messages from the server but also to manage and even store messages from client onto the server. Thunderbird is set to save a copy of the message you sent in the users sent folder. But also: the same is true for james =P. This is easy to fix: in thunderbird - go into account settings - select your james mail account - navigate to "copy & folders" on the left side - and just untick the two checkboxes labled "save copy into sent" and "save archive" - fixed. James will do the rest for you as it always copies a sent message - wich I personally find a neat option (but this can be disabled in config). Next thing you should address is a very important security thing: enable smtp auth enforcement in smtpserver.xml by un-comment this line: true Why is this important? In order to receive mails from the outside world - you have open TCP/25 to be reachable from the outside world - as this is how SMTP works. The main catch here: Any MTA (mail transfer agent) should only handle mails for domains it is authorized for - otherwise you will become a realy for mails of domains wich don't belong to you. In it's default configuration, james' SMTP server will accept any mail from any source and realy it to any target found in "To:" address. This is what's kown as an "open relay" and is a major security issue. By un-comment the above mentioned line you enforce a rule, that mails to any other target than your own domain can be send only when a connected user has correctly authenticated (logged in for that matter). Other client's trying to drop mails for other domains simply get an error message denying un-authorized relay. The last thing I set on my james is in domainlist.xml: change the autodetect from true to false and setting my domain "cryptearth.de" as the defaultDomain. Any thing else is ready to go by default and should need no further touch (or, if you someone like me, using MySQL/MariaDB - set james-database.properties to needed values). Next step: sudo /path/to/james/bin/james start - and you should be ready to go. After open TCP/25 for SMTP to receive mails and maybe TCP/143 for IMAP you should be able to send and receive mails. Oh, one more important thing: you should check domain and user by these commands: /path/to/james/bin/james-cli.sh -h localhost listdomains /path/to/james/bin/james-cli.sh -h localhost listusers The first should at least reply the domain you set in domainlist.xml as default domain, and the latter one the user you set. When you first start james, no users are set, so you need to add at least one: /path/to/james/bin/james-cli.sh -h localhost adduser user@domain password It's important, that you use the full user-name with domain-part, like this: webmas...@cryptearth.de Passwords are stored as MD5 hashed, but this can be changed in usersrepository.xml to some more secure like SHA-256, wich should be done when you use a real full-blown database server like me instead of file-based H2 wich is stored somewhere in james' directory tree. To add a bit more security, you can set a JavaKeyStore with a let's encrypt certificate (I do it this way) to activate encryption on client-to-server and server-to-server communication - but this should be for another mail as you need some more to get this working. Unless, you should not send sensitive data and should use a very unique password - as with encryption also your login-data transfered un-encrypted. - But we will come back to this in another e-mail if you like. That's it - now you should be up and running. Possible reasons, why you can't sent e-mails to others: 1) You're not a legitimate admin for the domain you want to use (you have to set some specific DNS-settings to make your domain fully working - like SPF). 2) You're tryin to use a host on your personal connection - wich should be blocked by almost any major system - for example: I have a root hosted at OVH in Roubaix - and a small backup here at home right next to me I can send mails only from my root - but not from my backup here at home as it flagged as spam as my personal ip is well known in a "dial-up range" used
Re: MalformedURLException: unknown protocol: classpath
Hey Marc, ah, I can see a lot of myself in you back when I used james first back in 2015 or so ... maybe I can help you out on some questions as I also learned a bit since then. But, if I fell, Benoit is one kind of a crack on james and, as far as I remember for my questions, always has some neat trick handy. I think he is glad to help another new user to join this awesome project. First, let me get on this "sent messages shows up twice in sent folder"-thing, as it took me ages to figure it out: To keep it short: it some wired issue when using thunderbird with james A bit more explain: IMAP is not only capable of downloading messages from the server but also to manage and even store messages from client onto the server. Thunderbird is set to save a copy of the message you sent in the users sent folder. But also: the same is true for james =P. This is easy to fix: in thunderbird - go into account settings - select your james mail account - navigate to "copy & folders" on the left side - and just untick the two checkboxes labled "save copy into sent" and "save archive" - fixed. James will do the rest for you as it always copies a sent message - wich I personally find a neat option (but this can be disabled in config). Next thing you should address is a very important security thing: enable smtp auth enforcement in smtpserver.xml by un-comment this line: true Why is this important? In order to receive mails from the outside world - you have open TCP/25 to be reachable from the outside world - as this is how SMTP works. The main catch here: Any MTA (mail transfer agent) should only handle mails for domains it is authorized for - otherwise you will become a realy for mails of domains wich don't belong to you. In it's default configuration, james' SMTP server will accept any mail from any source and realy it to any target found in "To:" address. This is what's kown as an "open relay" and is a major security issue. By un-comment the above mentioned line you enforce a rule, that mails to any other target than your own domain can be send only when a connected user has correctly authenticated (logged in for that matter). Other client's trying to drop mails for other domains simply get an error message denying un-authorized relay. The last thing I set on my james is in domainlist.xml: change the autodetect from true to false and setting my domain "cryptearth.de" as the defaultDomain. Any thing else is ready to go by default and should need no further touch (or, if you someone like me, using MySQL/MariaDB - set james-database.properties to needed values). Next step: sudo /path/to/james/bin/james start - and you should be ready to go. After open TCP/25 for SMTP to receive mails and maybe TCP/143 for IMAP you should be able to send and receive mails. Oh, one more important thing: you should check domain and user by these commands: /path/to/james/bin/james-cli.sh -h localhost listdomains /path/to/james/bin/james-cli.sh -h localhost listusers The first should at least reply the domain you set in domainlist.xml as default domain, and the latter one the user you set. When you first start james, no users are set, so you need to add at least one: /path/to/james/bin/james-cli.sh -h localhost adduser user@domain password It's important, that you use the full user-name with domain-part, like this: webmas...@cryptearth.de Passwords are stored as MD5 hashed, but this can be changed in usersrepository.xml to some more secure like SHA-256, wich should be done when you use a real full-blown database server like me instead of file-based H2 wich is stored somewhere in james' directory tree. To add a bit more security, you can set a JavaKeyStore with a let's encrypt certificate (I do it this way) to activate encryption on client-to-server and server-to-server communication - but this should be for another mail as you need some more to get this working. Unless, you should not send sensitive data and should use a very unique password - as with encryption also your login-data transfered un-encrypted. - But we will come back to this in another e-mail if you like. That's it - now you should be up and running. Possible reasons, why you can't sent e-mails to others: 1) You're not a legitimate admin for the domain you want to use (you have to set some specific DNS-settings to make your domain fully working - like SPF). 2) You're tryin to use a host on your personal connection - wich should be blocked by almost any major system - for example: I have a root hosted at OVH in Roubaix - and a small backup here at home right next to me I can send mails only from my root - but not from my backup here at home as it flagged as spam as my personal ip is well known in a "dial-up range" used for personal internet connections ISPs offer to private customers - although I have special contract offering my a static assigned IP with personal reverse-entry. 3) The IP doesn't have
Re: MalformedURLException: unknown protocol: classpath
I should have mentioned I am working with the imap server on James, not pop3... Marc.. On 02/18/2019 05:26 PM, Marc Chamberlin wrote: > Thanks Matt, you were correct, I needed to install the java-devel > packages. Maven then ran fine, kinda scary actually watching it run! > That is a LOT of code being downloaded and processed! I will table the > systemd issue for now and just concentrate on getting James running. I > like your idea of using crontab to work around it for now... > > Any wise, I installed the new version of James 3.4 and got closer to > getting it up and running. I set it up with one domain and one user > (myself) and I can now send and receive email to/from myself on it. But > I cannot send an outgoing email to anywhere else! I am using Thunderbird > to test it with and when I try to send an outgoing email to some other > domain, something weird is happening. It acts as if it sent it OK, but > it is showing up in the sent folder, in Thunderbird, twice! I tried to > send an email from my account on James to a GMail account I have and it > never showed up, so something is failing still. > > Going in the other direction, if I send an email from an outside server > to my account on James, I do receive it OK. > > BTW this latest version of James did not fix the log file problems I > reported earlier. Marc.. > > On 02/18/2019 11:12 AM, cryptearth wrote: >> Well, for me, I just added "@reboot /path/to/james/bin/james start" to >> my root crontab - no need for init.d/systemd. >> As the issue arised after you let systemctl create files - seems >> something went wrong there. >> >> As for your maven issue: do you have java-devel installed? >> >> Matt >> >> Am 18.02.2019 um 03:40 schrieb Benoit Tellier: >>> I am not sure you can use "james script" directly like this as a initd >>> script. >>> >>> What we do use in docker (and thus is maintained) is >>> >>> ./bin/wrapper-linux-x86-64 conf/wrapper.conf wrapper.syslog.ident=james >>> wrapper.pidfile=var/james.pid wrapper.daemonize=FALSE >>> >>> Cheers, >>> >>> Benoit >>> >>> On 2/18/19 7:39 a ²M, Marc Chamberlin wrote: Hi Matt, thanks for responding! It appears to me that "classpath" is actually defined in the startup scripts. There are two different scripts used to start the james server, either "james" or "run.sh". I do not believe "classpath" is defined in any of the config files themselves. I am not using "run.sh" to start the james server, instead I noted that the james script is configured with the classic init.d entry points - start, stop, restart, etc. I modified the "james" script slightly so that I could run james as a systemd service instead (see below). At this point I strongly suspect that the definition of environment variables, using the james startup script, is failing, so I am pursuing this to see what is going on. However, running james as a systemd service does not seem to be the problem, even if I just run the james startup script by itself, not as a service, I am still getting the same failure with the "classpath" variable. If anyone has ported james to run as a systemd service I would much appreciate knowing how you did it. What I have done was to add the init.d initialization comments to the beginning of the james shell script then let systemd take it from there to create the actual .service files - added to beginning of the james startup script to define init.d runlevels - ### BEGIN INIT INFO # Provides: james # Required-Start: $network $syslog $time # Required-Stop: $network $syslog $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Initscript for Apache James Mail Server ### END INIT INFO and FYI these are the steps I then took to set up the init.d services and then convert them to systemd services on OpenSuSE Leap 15.0 - First I created a soft link from /etc/init.d to the james startup script - ln -s /mail/apache-james-3.2/james-server-app-3.2.0/bin/james /etc/init.d/james Next install in james script into the various init.d runlevels cd /etc/init.d insserv james Next set up the systemd files from the new init.d configuration files and start the service. systemctl daemon-reload systemctl start james.service The james service does start up OK and will report that it is running when checking on it's status. It is just not working properly in accepting connections or doing the various tasks that the service should be doing and my goal at this point is to resolve any and all exceptions that are occurring such as this one. Marc... On 02/17/2019 06:01 AM, cryptearth wrote: > Hey Marc, Matt here. > > The provided stack only says that you given
Re: MalformedURLException: unknown protocol: classpath
Thanks Matt, you were correct, I needed to install the java-devel packages. Maven then ran fine, kinda scary actually watching it run! That is a LOT of code being downloaded and processed! I will table the systemd issue for now and just concentrate on getting James running. I like your idea of using crontab to work around it for now... Any wise, I installed the new version of James 3.4 and got closer to getting it up and running. I set it up with one domain and one user (myself) and I can now send and receive email to/from myself on it. But I cannot send an outgoing email to anywhere else! I am using Thunderbird to test it with and when I try to send an outgoing email to some other domain, something weird is happening. It acts as if it sent it OK, but it is showing up in the sent folder, in Thunderbird, twice! I tried to send an email from my account on James to a GMail account I have and it never showed up, so something is failing still. Going in the other direction, if I send an email from an outside server to my account on James, I do receive it OK. BTW this latest version of James did not fix the log file problems I reported earlier. Marc.. On 02/18/2019 11:12 AM, cryptearth wrote: > Well, for me, I just added "@reboot /path/to/james/bin/james start" to > my root crontab - no need for init.d/systemd. > As the issue arised after you let systemctl create files - seems > something went wrong there. > > As for your maven issue: do you have java-devel installed? > > Matt > > Am 18.02.2019 um 03:40 schrieb Benoit Tellier: >> I am not sure you can use "james script" directly like this as a initd >> script. >> >> What we do use in docker (and thus is maintained) is >> >> ./bin/wrapper-linux-x86-64 conf/wrapper.conf wrapper.syslog.ident=james >> wrapper.pidfile=var/james.pid wrapper.daemonize=FALSE >> >> Cheers, >> >> Benoit >> >> On 2/18/19 7:39 a ²M, Marc Chamberlin wrote: >>> Hi Matt, thanks for responding! It appears to me that "classpath" is >>> actually defined in the startup scripts. There are two different >>> scripts >>> used to start the james server, either "james" or "run.sh". I do not >>> believe "classpath" is defined in any of the config files themselves. I >>> am not using "run.sh" to start the james server, instead I noted that >>> the james script is configured with the classic init.d entry points - >>> start, stop, restart, etc. I modified the "james" script slightly so >>> that I could run james as a systemd service instead (see below). At >>> this >>> point I strongly suspect that the definition of environment variables, >>> using the james startup script, is failing, so I am pursuing this to >>> see what is going on. However, running james as a systemd service does >>> not seem to be the problem, even if I just run the james startup script >>> by itself, not as a service, I am still getting the same failure with >>> the "classpath" variable. >>> >>> If anyone has ported james to run as a systemd service I would much >>> appreciate knowing how you did it. What I have done was to add the >>> init.d initialization comments to the beginning of the james shell >>> script then let systemd take it from there to create the actual >>> .service >>> files - >>> added to beginning of the james startup script to define init.d >>> runlevels - >>> >>> ### BEGIN INIT INFO >>> # Provides: james >>> # Required-Start: $network $syslog $time >>> # Required-Stop: $network $syslog $time >>> # Default-Start: 2 3 4 5 >>> # Default-Stop: 0 1 6 >>> # Description: Initscript for Apache James Mail Server >>> ### END INIT INFO >>> >>> and FYI these are the steps I then took to set up the init.d services >>> and then convert them to systemd services on OpenSuSE Leap 15.0 - >>> >>> First I created a soft link from /etc/init.d to the james startup >>> script - >>> >>> ln -s /mail/apache-james-3.2/james-server-app-3.2.0/bin/james >>> /etc/init.d/james >>> >>> Next install in james script into the various init.d runlevels >>> >>> cd /etc/init.d >>> insserv james >>> >>> Next set up the systemd files from the new init.d configuration files >>> and start the service. >>> >>> systemctl daemon-reload >>> systemctl start james.service >>> >>> The james service does start up OK and will report that it is running >>> when checking on it's status. It is just not working properly in >>> accepting connections or doing the various tasks that the service >>> should >>> be doing and my goal at this point is to resolve any and all exceptions >>> that are occurring such as this one. >>> >>> Marc... >>> >>> >>> >>> On 02/17/2019 06:01 AM, cryptearth wrote: Hey Marc, Matt here. The provided stack only says that you given "classpath" to some parameter wich expectes a url in some config file. So I guess it could help if you also show the config where you set "classpath" so one can figure out, if "classpath" is a legal input for the setting you set it. >>> >>
Re: MalformedURLException: unknown protocol: classpath
Well, for me, I just added "@reboot /path/to/james/bin/james start" to my root crontab - no need for init.d/systemd. As the issue arised after you let systemctl create files - seems something went wrong there. As for your maven issue: do you have java-devel installed? Matt Am 18.02.2019 um 03:40 schrieb Benoit Tellier: I am not sure you can use "james script" directly like this as a initd script. What we do use in docker (and thus is maintained) is ./bin/wrapper-linux-x86-64 conf/wrapper.conf wrapper.syslog.ident=james wrapper.pidfile=var/james.pid wrapper.daemonize=FALSE Cheers, Benoit On 2/18/19 7:39 a ²M, Marc Chamberlin wrote: Hi Matt, thanks for responding! It appears to me that "classpath" is actually defined in the startup scripts. There are two different scripts used to start the james server, either "james" or "run.sh". I do not believe "classpath" is defined in any of the config files themselves. I am not using "run.sh" to start the james server, instead I noted that the james script is configured with the classic init.d entry points - start, stop, restart, etc. I modified the "james" script slightly so that I could run james as a systemd service instead (see below). At this point I strongly suspect that the definition of environment variables, using the james startup script, is failing, so I am pursuing this to see what is going on. However, running james as a systemd service does not seem to be the problem, even if I just run the james startup script by itself, not as a service, I am still getting the same failure with the "classpath" variable. If anyone has ported james to run as a systemd service I would much appreciate knowing how you did it. What I have done was to add the init.d initialization comments to the beginning of the james shell script then let systemd take it from there to create the actual .service files - added to beginning of the james startup script to define init.d runlevels - ### BEGIN INIT INFO # Provides: james # Required-Start: $network $syslog $time # Required-Stop: $network $syslog $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Initscript for Apache James Mail Server ### END INIT INFO and FYI these are the steps I then took to set up the init.d services and then convert them to systemd services on OpenSuSE Leap 15.0 - First I created a soft link from /etc/init.d to the james startup script - ln -s /mail/apache-james-3.2/james-server-app-3.2.0/bin/james /etc/init.d/james Next install in james script into the various init.d runlevels cd /etc/init.d insserv james Next set up the systemd files from the new init.d configuration files and start the service. systemctl daemon-reload systemctl start james.service The james service does start up OK and will report that it is running when checking on it's status. It is just not working properly in accepting connections or doing the various tasks that the service should be doing and my goal at this point is to resolve any and all exceptions that are occurring such as this one. Marc... On 02/17/2019 06:01 AM, cryptearth wrote: Hey Marc, Matt here. The provided stack only says that you given "classpath" to some parameter wich expectes a url in some config file. So I guess it could help if you also show the config where you set "classpath" so one can figure out, if "classpath" is a legal input for the setting you set it. - 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
Re: MalformedURLException: unknown protocol: classpath
On 02/17/2019 06:01 AM, cryptearth wrote: > git clone -b master https://github.com/apache/james-project james folder> > > branch 3.2.0 is completed and isn't worked on anymore, branch 3.2.x > got last update in Dec 10, 2018 - so you have to use master branch to > get current fixes > to compile james from source - cd into your james directory and type: > mvn clean package > I would recommend to also add: -DskipTests > to save time - and, well, if you haven't set up docker, the tests fail > at this point wich fails the whole project. With skipping tests depend > on power takes about 15min to compile. Completed pack is then found in > /server/app/target/james-server-[version]-app.tar.gz > (and .zip). Simple extract it to where you want - check config in > /conf (check domainlist.xml is most important - all other > shouldn't need not touch at all) - and james should be able to start > up with /bin/james start > > Matt Hi Matt, I took a shot at downloading and building james, and it didn't seem to go well... A lot of stuff got downloaded and then this resulted. Got any ideas? (lots of hits on Google about "Could not find artifact com.sun:tools:jar:1.8.0" but none of the solutions seem applicable...) Marc.. Downloaded from central: https://repo.maven.apache.org/maven2/net/sf/saxon/Saxon-HE/9.8.0-5/Saxon-HE-9.8.0-5.jar (5.0 MB at 2.2 MB/s) [INFO] [INFO] Reactor Summary for Apache James Project 3.4.0-SNAPSHOT: [INFO] [INFO] Apache James Project ... FAILURE [ 13.817 s] [INFO] Apache James :: Server . SKIPPED [INFO] Apache James :: Server :: Common Utilities . SKIPPED [INFO] Apache James :: Java Mail Extension SKIPPED [INFO] Apache James :: Core Domain Objects SKIPPED [INFO] Apache James :: Server :: Lifecycle API SKIPPED [INFO] Apache James :: Server :: Task . SKIPPED [INFO] Apache JAMES backends common ... SKIPPED [INFO] Apache James Cassandra backend . SKIPPED [INFO] Apache James :: Mailbox SKIPPED [INFO] Apache James :: Mailbox :: API . SKIPPED [INFO] Apache James :: Mailets parent and aggregator .. SKIPPED [INFO] Apache James :: Mailet API . SKIPPED [INFO] Apache James :: Test helpers for Mailet SKIPPED [INFO] Apache James :: Server :: Testing .. SKIPPED [INFO] apache-james-backends-es ... SKIPPED [INFO] apache-james-backends-jpa .. SKIPPED [INFO] Apache James RabbitMQ backend .. SKIPPED [INFO] Apache James :: Event Sourcing . SKIPPED [INFO] Apache James :: Event sourcing :: pojo . SKIPPED [INFO] Apache James :: Event Sourcing :: Event Store :: API SKIPPED [INFO] Apache James :: Event sourcing :: core . SKIPPED [INFO] Apache James :: Event sourcing :: Event Store :: Cassandra SKIPPED [INFO] Apache James :: Event sourcing :: Event Store :: Memory SKIPPED [INFO] Apache James :: Basic Mailet Toolkit ... SKIPPED [INFO] Apache James :: Examples ... SKIPPED [INFO] custom-mailets . SKIPPED [INFO] Apache James :: Metrics SKIPPED [INFO] Apache James :: Metrics :: API . SKIPPED [INFO] Apache James :: Mailbox :: Event :: In VM implementation SKIPPED [INFO] Apache James :: MDN SKIPPED [INFO] Apache James :: Mailbox :: Store Framework . SKIPPED [INFO] Apache James :: Mailbox :: Backup .. SKIPPED [INFO] Apache James :: Mailbox :: Caching . SKIPPED [INFO] Apache James :: Server :: Blob . SKIPPED [INFO] Apache James :: Server :: Blob :: API .. SKIPPED [INFO] Apache James :: Server :: Blob :: Cassandra SKIPPED [INFO] Apache James :: Server :: Filesystem API ... SKIPPED [INFO] Apache James :: Server :: Core . SKIPPED [INFO] Apache James :: Server :: MailRepository :: API SKIPPED [INFO] Apache James :: Server :: Data :: API . SKIPPED [INFO] Apache James :: Mailbox :: Cassandra ... SKIPPED [INFO] Apache James :: Mailbox :: In Memory ... SKIPPED [INFO] Apache James :: Mailbox :: Tika SKIPPED [INFO] Apache James :: Mailbox :: ElasticSearch ... SKIPPED [INFO] Apache James :: Mailbox :: Event :: JSON ... SKIPPED [INFO] Apache James :: Mailbox :: Event :: RabbitMQ implementation SKIPPED [INFO] Apache James :: Mailbox :: JPA . SKIPPED [INFO] Apache James :: Mailbox :: Lucene Index SKIPPED [INFO] Apache James :: Mailbox :: Maildir . SKIPPED [INFO] Apache James :: Server :: DNS Service :: API
Re: MalformedURLException: unknown protocol: classpath
I am not sure you can use "james script" directly like this as a initd script. What we do use in docker (and thus is maintained) is ./bin/wrapper-linux-x86-64 conf/wrapper.conf wrapper.syslog.ident=james wrapper.pidfile=var/james.pid wrapper.daemonize=FALSE Cheers, Benoit On 2/18/19 7:39 a ²M, Marc Chamberlin wrote: > Hi Matt, thanks for responding! It appears to me that "classpath" is > actually defined in the startup scripts. There are two different scripts > used to start the james server, either "james" or "run.sh". I do not > believe "classpath" is defined in any of the config files themselves. I > am not using "run.sh" to start the james server, instead I noted that > the james script is configured with the classic init.d entry points - > start, stop, restart, etc. I modified the "james" script slightly so > that I could run james as a systemd service instead (see below). At this > point I strongly suspect that the definition of environment variables, > using the james startup script, is failing, so I am pursuing this to > see what is going on. However, running james as a systemd service does > not seem to be the problem, even if I just run the james startup script > by itself, not as a service, I am still getting the same failure with > the "classpath" variable. > > If anyone has ported james to run as a systemd service I would much > appreciate knowing how you did it. What I have done was to add the > init.d initialization comments to the beginning of the james shell > script then let systemd take it from there to create the actual .service > files - > > added to beginning of the james startup script to define init.d runlevels - > > ### BEGIN INIT INFO > # Provides: james > # Required-Start: $network $syslog $time > # Required-Stop: $network $syslog $time > # Default-Start: 2 3 4 5 > # Default-Stop: 0 1 6 > # Description: Initscript for Apache James Mail Server > ### END INIT INFO > > and FYI these are the steps I then took to set up the init.d services > and then convert them to systemd services on OpenSuSE Leap 15.0 - > > First I created a soft link from /etc/init.d to the james startup script - > > ln -s /mail/apache-james-3.2/james-server-app-3.2.0/bin/james > /etc/init.d/james > > Next install in james script into the various init.d runlevels > > cd /etc/init.d > insserv james > > Next set up the systemd files from the new init.d configuration files > and start the service. > > systemctl daemon-reload > systemctl start james.service > > The james service does start up OK and will report that it is running > when checking on it's status. It is just not working properly in > accepting connections or doing the various tasks that the service should > be doing and my goal at this point is to resolve any and all exceptions > that are occurring such as this one. > > Marc... > > > > On 02/17/2019 06:01 AM, cryptearth wrote: >> Hey Marc, Matt here. >> >> The provided stack only says that you given "classpath" to some >> parameter wich expectes a url in some config file. So I guess it could >> help if you also show the config where you set "classpath" so one can >> figure out, if "classpath" is a legal input for the setting you set it. > > - To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org
Re: MalformedURLException: unknown protocol: classpath
Hi Matt, thanks for responding! It appears to me that "classpath" is actually defined in the startup scripts. There are two different scripts used to start the james server, either "james" or "run.sh". I do not believe "classpath" is defined in any of the config files themselves. I am not using "run.sh" to start the james server, instead I noted that the james script is configured with the classic init.d entry points - start, stop, restart, etc. I modified the "james" script slightly so that I could run james as a systemd service instead (see below). At this point I strongly suspect that the definition of environment variables, using the james startup script, is failing, so I am pursuing this to see what is going on. However, running james as a systemd service does not seem to be the problem, even if I just run the james startup script by itself, not as a service, I am still getting the same failure with the "classpath" variable. If anyone has ported james to run as a systemd service I would much appreciate knowing how you did it. What I have done was to add the init.d initialization comments to the beginning of the james shell script then let systemd take it from there to create the actual .service files - added to beginning of the james startup script to define init.d runlevels - ### BEGIN INIT INFO # Provides: james # Required-Start: $network $syslog $time # Required-Stop: $network $syslog $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Initscript for Apache James Mail Server ### END INIT INFO and FYI these are the steps I then took to set up the init.d services and then convert them to systemd services on OpenSuSE Leap 15.0 - First I created a soft link from /etc/init.d to the james startup script - ln -s /mail/apache-james-3.2/james-server-app-3.2.0/bin/james /etc/init.d/james Next install in james script into the various init.d runlevels cd /etc/init.d insserv james Next set up the systemd files from the new init.d configuration files and start the service. systemctl daemon-reload systemctl start james.service The james service does start up OK and will report that it is running when checking on it's status. It is just not working properly in accepting connections or doing the various tasks that the service should be doing and my goal at this point is to resolve any and all exceptions that are occurring such as this one. Marc... On 02/17/2019 06:01 AM, cryptearth wrote: > Hey Marc, Matt here. > > The provided stack only says that you given "classpath" to some > parameter wich expectes a url in some config file. So I guess it could > help if you also show the config where you set "classpath" so one can > figure out, if "classpath" is a legal input for the setting you set it. -- Linux Counter
Re: MalformedURLException: unknown protocol: classpath
Hey Marc, Matt here. The provided stack only says that you given "classpath" to some parameter wich expectes a url in some config file. So I guess it could help if you also show the config where you set "classpath" so one can figure out, if "classpath" is a legal input for the setting you set it. To get current source, just clone git: git clone -b master https://github.com/apache/james-project folder> branch 3.2.0 is completed and isn't worked on anymore, branch 3.2.x got last update in Dec 10, 2018 - so you have to use master branch to get current fixes to compile james from source - cd into your james directory and type: mvn clean package I would recommend to also add: -DskipTests to save time - and, well, if you haven't set up docker, the tests fail at this point wich fails the whole project. With skipping tests depend on power takes about 15min to compile. Completed pack is then found in /server/app/target/james-server-[version]-app.tar.gz (and .zip). Simple extract it to where you want - check config in /conf (check domainlist.xml is most important - all other shouldn't need not touch at all) - and james should be able to start up with /bin/james start Matt Am 17.02.2019 um 08:29 schrieb Marc Chamberlin: I am still trying to configure and set up a new Apache James 3.2.0 with Spring wiring and am running into a new snag. I suspect I am overlooking something in the config files. So can a kind guru decipher this stack walkback, shown in the wrapper.log file, and give me a clue on how to fix and make James a happy camper? I won't show the entire stack walkback just what I think are the highlights, but if anyone wants the whole thing I certainly can provide it. (Benoit - I have not figured out how to acquire the source code, with the fixes you mentioned in my previous threads, and build/test the new version of James. Perhaps you could send me instructions? Just send me a link to the source code and a Makefile preferably, I have never used Docker and don't understand how that works.. ) Thanks in advance... Marc INFO | jvm 1| 2019/02/16 22:51:04 | 22:51:04.843 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 13 bean definitions from location pattern [classpath:META-INF/spring/loaders-context.xml] INFO | jvm 1| 2019/02/16 22:51:04 | 22:51:04.843 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Imported 13 bean definitions from URL location [classpath:META-INF/spring/loaders-context.xml] INFO | jvm 1| 2019/02/16 22:51:04 | 22:51:04.843 [WrapperSimpleAppMain] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/org/apache/james/spring-mailbox-authenticator.xml] INFO | jvm 1| 2019/02/16 22:51:04 | 22:51:04.844 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] INFO | jvm 1| 2019/02/16 22:51:04 | 22:51:04.846 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver - Could not resolve XML entity [classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd] against system root URL INFO | jvm 1| 2019/02/16 22:51:04 | java.net.MalformedURLException: unknown protocol: classpath INFO | jvm 1| 2019/02/16 22:51:04 | at java.net.URL.(URL.java:600) INFO | jvm 1| 2019/02/16 22:51:04 | at java.net.URL.(URL.java:490) INFO | jvm 1| 2019/02/16 22:51:04 | at java.net.URL.(URL.java:439) INFO | jvm 1| 2019/02/16 22:51:04 | at org.springframework.beans.factory.xml.ResourceEntityResolver.resolveEntity(ResourceEntityResolver.java:79) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:110) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:1081) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(XMLSchemaLoader.java:654) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2431) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1768) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741) INFO | jvm 1| 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) INFO | jvm 1| 2019/02/16
MalformedURLException: unknown protocol: classpath
I am still trying to configure and set up a new Apache James 3.2.0 with Spring wiring and am running into a new snag. I suspect I am overlooking something in the config files. So can a kind guru decipher this stack walkback, shown in the wrapper.log file, and give me a clue on how to fix and make James a happy camper? I won't show the entire stack walkback just what I think are the highlights, but if anyone wants the whole thing I certainly can provide it. (Benoit - I have not figured out how to acquire the source code, with the fixes you mentioned in my previous threads, and build/test the new version of James. Perhaps you could send me instructions? Just send me a link to the source code and a Makefile preferably, I have never used Docker and don't understand how that works.. ) Thanks in advance... Marc INFO | jvm 1 | 2019/02/16 22:51:04 | 22:51:04.843 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 13 bean definitions from location pattern [classpath:META-INF/spring/loaders-context.xml] INFO | jvm 1 | 2019/02/16 22:51:04 | 22:51:04.843 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Imported 13 bean definitions from URL location [classpath:META-INF/spring/loaders-context.xml] INFO | jvm 1 | 2019/02/16 22:51:04 | 22:51:04.843 [WrapperSimpleAppMain] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/org/apache/james/spring-mailbox-authenticator.xml] INFO | jvm 1 | 2019/02/16 22:51:04 | 22:51:04.844 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] INFO | jvm 1 | 2019/02/16 22:51:04 | 22:51:04.846 [WrapperSimpleAppMain] DEBUG org.springframework.beans.factory.xml.ResourceEntityResolver - Could not resolve XML entity [classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd] against system root URL INFO | jvm 1 | 2019/02/16 22:51:04 | java.net.MalformedURLException: unknown protocol: classpath INFO | jvm 1 | 2019/02/16 22:51:04 | at java.net.URL.(URL.java:600) INFO | jvm 1 | 2019/02/16 22:51:04 | at java.net.URL.(URL.java:490) INFO | jvm 1 | 2019/02/16 22:51:04 | at java.net.URL.(URL.java:439) INFO | jvm 1 | 2019/02/16 22:51:04 | at org.springframework.beans.factory.xml.ResourceEntityResolver.resolveEntity(ResourceEntityResolver.java:79) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:110) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:1081) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(XMLSchemaLoader.java:654) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2431) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1768) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) INFO | jvm 1 | 2019/02/16 22:51:04 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) INFO | jvm 1 |