• script import mail

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #43651  by jllort
 
Do you see some error from catalina.log file ?
 #43670  by snowman
 
I can now confirm that another independent Installation shows the same behavior.
 #43673  by jllort
 
That not helps much, I'm asking about catalina.log file, is there some error while you are doing it ? if there's some error, please share with us the catalina.log file to see it.
 #43727  by snowman
 
HI,

I am sorry. I did not see your post. I turned on debug in catalina log and got roughly 130kB of messages. There is no ERROR line in it. I do not know what to look for.
Some interesting parts may be:
Code: Select all
2017-05-01 00:09:32,429 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.tomcat.util.modeler.BaseModelMBean- preRegister org.apache.coyote.RequestInfo@7671c334 Catalina:type=RequestProcessor,worker="http-bio-0.0.0.0-8080",name=HttpRequest1
2017-05-01 00:09:32,450 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.tomcat.util.http.Parameters- Set query string encoding to null
2017-05-01 00:09:32,451 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [uriBC] has value [/OpenKM/services/rest/mail/importEML]
2017-05-01 00:09:32,451 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [semicolon] has value [-1]
2017-05-01 00:09:32,451 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [enc] has value [ISO-8859-1]
2017-05-01 00:09:32,452 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Security checking request POST /OpenKM/services/rest/mail/importEML
2017-05-01 00:09:32,452 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.realm.RealmBase-   No applicable constraints defined
2017-05-01 00:09:32,452 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase-  Not subject to any constraint
2017-05-01 00:09:32,462 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- loadClass(org.springframework.security.web.firewall.FirewalledResponse, false)
2017-05-01 00:09:32,462 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,462 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findClass(org.springframework.security.web.firewall.FirewalledResponse)
2017-05-01 00:09:32,466 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Loading class from local repository
[ ... there are a lot of Searching local Repositories findClass(...) ... ]

Here it starts with "not found, returning null:
Code: Select all
2017-05-01 00:09:32,740 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- getResourceAsStream(org/apache/cxf/transport/https/Messages.properties)
2017-05-01 00:09:32,740 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,740 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findResource(org/apache/cxf/transport/https/Messages.properties)
2017-05-01 00:09:32,741 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     --> Returning 'jar:file:/data/bin/openkm-6.3.3/tomcat/webapps/OpenKM/WEB-INF/lib/cxf-rt-transports-http-2.7.12.jar!/org/apache/cxf/transport/https/Messages.properties'
2017-05-01 00:09:32,741 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   --> Returning stream from local
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- loadClass(org.apache.cxf.transport.https.Messages_de, false)
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findClass(org.apache.cxf.transport.https.Messages_de)
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Delegating to parent classloader at end: org.apache.catalina.loader.StandardClassLoader@bf4b610
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- getResourceAsStream(org/apache/cxf/transport/https/Messages_de.properties)
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findResource(org/apache/cxf/transport/https/Messages_de.properties)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     --> Resource not found, returning null
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Delegating to parent classloader unconditionally org.apache.catalina.loader.StandardClassLoader@bf4b610
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   --> Resource not found, returning null
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- loadClass(org.apache.cxf.transport.https.Messages_de_DE, false)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findClass(org.apache.cxf.transport.https.Messages_de_DE)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Delegating to parent classloader at end: org.apache.catalina.loader.StandardClassLoader@bf4b610
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- getResourceAsStream(org/apache/cxf/transport/https/Messages_de_DE.properties)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findResource(org/apache/cxf/transport/https/Messages_de_DE.properties)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     --> Resource not found, returning null
[... lot of Searching local repositories, it appears to end with: ]
Code: Select all
2017-05-01 00:09:32,813 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Loading class from local repository
2017-05-01 00:09:32,815 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.coyote.http11.Http11Protocol- Socket: [org.apache.tomcat.util.net.SocketWrapper@3ebee16e:Socket[addr=/127.0.0.1,port=48376,localport=8080]], Status in: [OPEN_READ], State out: [CLOSED]
2017-05-01 00:09:32,816 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.tomcat.util.threads.LimitLatch- Counting down[http-bio-0.0.0.0-8080-exec-1] latch=1
Does this help?
 #43732  by snowman
 
OK. I tried.
The -d option of curl does not go together with the -F option. With -d I cannot give the target path. So I guess I have to stick with -F.
Man page says there is difference if you transfer a file using -F content=@file and -F content=<file . I tried both. No success.
Then I applied all plausible mime types as -H "Content-type: XXX/YYY". No success.

As I get a 404 in the curl verbose output. I wonder if something is wrong with either my target path: dstId='/okm:root/test/', which should be the (existing) folder test directly under root. I also tried the UUID of this folder.
Or something is wrong with my url:
http://localhost:8080/OpenKM/services/r ... /importEML

I am stuck.
 #43741  by jllort
 
I have tested and for me it is going right.

Note:
- I have OpenKM in port 8180, you must change to your port
- Execute the command in the same folder you have the file test.eml
- Ensure you are executing OpenKM version 6.3.3 ( in previous version you do not have import mail support )
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" -X POST -F dstId=/okm:root/ -F content=@test.eml http://localhost:8180/OpenKM/services/rest/mail/importEml
Attachments
(3.6 KiB) Downloaded 258 times
 #43759  by snowman
 
Ok. It works now. The error was trivial. The url ends with ../importEml not importEML ! Oh my.
Thank you for your patient help.
 #43763  by jllort
 
We are working to offering better documentation about REST webservices with some automatic tool for publishing it. Actualy we are working in professional version for it and I hope in nearly future we can release the same for community version. Best documentation of it, sure might helped you.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.