Page 1 of 2

[Solved] IMAP trouble ?

PostPosted:Mon Feb 08, 2010 12:00 pm
by jhashe
Hello,

I had some difficulties to integrate IMAP with OpenKM, because of self-signed certificats (see this thread: http://forum.openkm.com/viewtopic.php?f=5&t=3567).
But now, it works :)

But I don't understand why it only take one mail; I putted 4 mails in my folder, but there is only one in OpenKM. It isn't a problem with the mail itself, because if I remove it from my folder, I can receive another one. But it is like if it was only enable to keep one.

And another question: how to share mails stored in OpenKM. I gave rights for other users to access to my mail folder, but they don't see it.

Thank's for your help !

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 12:02 pm
by jhashe
I don't know if it hemp, but I have some warning in my logs:

ERROR [MailUtils] A9 NO mailbox selected READ-ONLY
javax.mail.MessagingException: A9 NO mailbox selected READ-ONLY;
nested exception is:
com.sun.mail.iap.CommandFailedException: A9 NO mailbox selected READ-ONLY
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:847)
at javax.mail.Message.setFlag(Message.java:565)
at es.git.openkm.util.MailUtils.importMessages(MailUtils.java:276)
at es.git.openkm.core.UserMailImporter.run(UserMailImporter.java:52)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: com.sun.mail.iap.CommandFailedException: A9 NO mailbox selected READ-ONLY
at com.sun.mail.iap.Protocol.handleResult(Protocol.java:294)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1294)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1279)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:843)
... 5 more
12:51:43,181 WARN [OKMRemoteServiceServlet] ** Session token is NULL **
12:51:43,181 WARN [OKMRemoteServiceServlet] ** ContextPath = /OpenKM **
12:51:43,181 WARN [OKMRemoteServiceServlet] ** PathInfo = null **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** RemoteAddr = 127.0.0.1 **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** COOKIE Name = JSESSIONID, Value=9C8937050FC1050A8CB0ACF959D2EC0C, Path=null, Domain=null **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER accept = */* **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER accept-language = fr-FR,FR;q=0.5 **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER referer = http://www.myOpenKMserver.com/OpenKM/es ... cache.html **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER content-type = text/x-gwt-rpc; charset=utf-8 **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER accept-encoding = gzip, deflate **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER user-agent = Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729) **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER host = www.myOpenKMserver.com **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER content-length = 176 **
12:51:43,182 WARN [OKMRemoteServiceServlet] ** HEADER connection = Keep-Alive **
12:51:43,183 WARN [OKMRemoteServiceServlet] ** HEADER cache-control = no-cache **
12:51:43,183 WARN [OKMRemoteServiceServlet] ** HEADER cookie = JSESSIONID=9C8937050FC1050A8CB0ACF959D2EC0C **
12:51:43,183 WARN [OKMRemoteServiceServlet] ** HEADER x-forwarded-for = 90.84.48.123 **

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 1:24 pm
by pavila
OpenKM only import emails with the SEEN flag set to false. Once it import the mail, set the flag to true.

To share an email you should copy it to the taxonomy context.

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 1:51 pm
by jhashe
Thanks you for your answer Pavila;

My goal was to create a specific adress for OpenKM (for example openkm@mydomain.com), and to create an OpenKM user which would import the mails into OpenKM. In this way, I would'nt have to configure each user account, and every body could store an email with an easy way => transfert it to openkm@mydomain.com (every imported mail should be shared; if it isn't, we simply don't put it in OpenKM :wink: )

So, the mailbox is NEVER opened by itself (only by OpenKM), and so, all the SEEN flags are false. So it isn't the reason why OpenKM only imported the first mail. And, if I remove it, so, at the next computation, another mail will be imported.

And, as the only way to share mails is to use taxonomy context, is there a way to automatically copy or move an incoming mail to a specific folder ?

I also have another question about mails. The search functions seems no to run on emails (but it works fine for all Taxonomy). Is it "normal" or is it a consequence of my import trouble ?

PS: I hope my english is good enough to be understandable.

Once again, thanks for your help

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 2:39 pm
by jllort
Give us some complet example on how you're making search. And which result you spect and are not showed.

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 2:51 pm
by jhashe
My test is very simple.
I go on the "search" tab, I choose the "E-mail" context, and I give one word I know to be in the mail. I tried with the "content" box and with the "content" box, each time giving only one word. I tried with a word from the subject, and with another present in the body. But it always gave no result (I even used the clipbord to be sure I did no error)

I also made another test:
I gave no criteria, except the date (Date range between..)
Even in this case, it founded no result.

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 2:56 pm
by jhashe
Another think;

As OpenKM only import the first mail of my folder, I wondered if it wasn't a trouble with our mail server. So I created a gmail account, and I configured OpenKM to use it, as given in this thread http://forum.openkm.com/viewtopic.php?f=5&t=3567 (2nd message)

But even with gmail, it only imported ONE mail (and not all of them). And I'm sure they were marked as "non readed"

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 3:04 pm
by jhashe
Here it is the logs:

ERROR [es.git.openkm.util.MailUtils] A8 NO STORE attempt on READ-ONLY folder (Failure)
javax.mail.MessagingException: A8 NO STORE attempt on READ-ONLY folder (Failure);
nested exception is:
com.sun.mail.iap.CommandFailedException: A8 NO STORE attempt on READ-ONLY folder (Failure)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:847)
at javax.mail.Message.setFlag(Message.java:565)
at es.git.openkm.util.MailUtils.importMessages(MailUtils.java:276)
at es.git.openkm.core.UserMailImporter.run(UserMailImporter.java:52)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: com.sun.mail.iap.CommandFailedException: A8 NO STORE attempt on READ-ONLY folder (Failure)
at com.sun.mail.iap.Protocol.handleResult(Protocol.java:294)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1294)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1279)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:843)
... 5 more
2010-02-08 15:51:43,013 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** Session token is NULL **
2010-02-08 15:51:43,013 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** ContextPath = /OpenKM **
2010-02-08 15:51:43,013 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** PathInfo = null **
2010-02-08 15:51:43,013 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** RemoteAddr = 127.0.0.1 **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** COOKIE Name = JSESSIONID, Value=9C8937050FC1050A8CB0ACF959D2EC0C, Path=null, Domain=null **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER accept = */* **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER accept-language = fr-FR,FR;q=0.5 **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER referer = http://www.myserver.com/OpenKM/es.git.o ... cache.html **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER content-type = text/x-gwt-rpc; charset=utf-8 **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER accept-encoding = gzip, deflate **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER user-agent = Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729) **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER host = www.myserver.com **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER content-length = 176 **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER connection = Keep-Alive **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER cache-control = no-cache **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER cookie = JSESSIONID=9C8937050FC1050A8CB0ACF959D2EC0C **
2010-02-08 15:51:43,014 WARN [es.git.openkm.frontend.server.OKMRemoteServiceServlet] ** HEADER x-forwarded-for = 90.84.48.123 **

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 4:27 pm
by pavila
I've check the mail import code and there is a bug: the IMAP folder should be opened as READ_WRITE and not on READ_ONLY mode.

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 5:00 pm
by jhashe
May I do something to bypass this bug, or must we wait for an update ?

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 5:03 pm
by jhashe
And many thanks for this help.
This forum is very usefull for users

Re: IMAP trouble ?

PostPosted:Mon Feb 08, 2010 9:31 pm
by jllort
jhashe wrote:Another think;

As OpenKM only import the first mail of my folder, I wondered if it wasn't a trouble with our mail server. So I created a gmail account, and I configured OpenKM to use it, as given in this thread http://forum.openkm.com/viewtopic.php?f=5&t=3567 (2nd message)

But even with gmail, it only imported ONE mail (and not all of them). And I'm sure they were marked as "non readed"
Sure all mails have been marked with tag too ?

Re: IMAP trouble ?

PostPosted:Tue Feb 09, 2010 8:34 am
by jhashe
Yes I am !
And, as I said, if I delete the mail which had previously been imported, the next time, the second mail will be imported !

I suppose there is a link with the error message:

ERROR [MailUtils] A13 NO STORE attempt on READ-ONLY folder (Failure)
javax.mail.MessagingException: A13 NO STORE attempt on READ-ONLY folder (Failure);
nested exception is:
com.sun.mail.iap.CommandFailedException: A13 NO STORE attempt on READ-ONLY folder (Failure)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:847)
at javax.mail.Message.setFlag(Message.java:565)
at es.git.openkm.util.MailUtils.importMessages(MailUtils.java:276)
at es.git.openkm.core.UserMailImporter.run(UserMailImporter.java:52)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: com.sun.mail.iap.CommandFailedException: A13 NO STORE attempt on READ-ONLY folder (Failure)
at com.sun.mail.iap.Protocol.handleResult(Protocol.java:294)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1294)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1279)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:843)

Re: IMAP trouble ?

PostPosted:Sat Feb 20, 2010 4:07 pm
by pavila
I can confirm this as a bug. It is already solved in the subversion repository.

Re: [Solved] IMAP trouble ?

PostPosted:Thu Apr 15, 2010 7:43 am
by jhashe
I've just updated to the last version (openKM 4.1-RC1) and the problem has been solved :D

If I could have another request !

It would be great if:

1) when clicking on the "Refresh" button, the server would check for new mails. So we wouldn't have to wait for an hour (it's so long :wink: ) before finding the new mails in OpenKM.
2) if there was an way to share the Mail context or (better), if we could apply rules on incoming mails (like in mails clients) so as to automatically class them in specific folders (for example, if the recipient ot the mail is "MrXXX" so move it to Taxonomy>Custumers>MrXXX>Mails)