svn commit: r1188733 - /james/protocols/tags/protocols-1.6-beta2/

2011-10-25 Thread norman
Author: norman
Date: Tue Oct 25 15:45:11 2011
New Revision: 1188733

URL: http://svn.apache.org/viewvc?rev=1188733&view=rev
Log:
[maven-release-plugin]  copy for tag protocols-1.6-beta2

Added:
james/protocols/tags/protocols-1.6-beta2/
  - copied from r1188732, james/protocols/trunk/


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1188732 - in /james/protocols/trunk: api/pom.xml impl/pom.xml lmtp/pom.xml pom.xml smtp/pom.xml

2011-10-25 Thread norman
Author: norman
Date: Tue Oct 25 15:45:01 2011
New Revision: 1188732

URL: http://svn.apache.org/viewvc?rev=1188732&view=rev
Log:
[maven-release-plugin] prepare release protocols-1.6-beta2

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/impl/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/smtp/pom.xml

Modified: james/protocols/trunk/api/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/pom.xml?rev=1188732&r1=1188731&r2=1188732&view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Tue Oct 25 15:45:01 2011
@@ -17,16 +17,13 @@
 specific language governing permissions and limitations
 under the License.
 -->
-http://maven.apache.org/POM/4.0.0";
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
 
 protocols
 org.apache.james
-1.6-beta2-SNAPSHOT
+1.6-beta2
 ../pom.xml
 
 

Modified: james/protocols/trunk/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/pom.xml?rev=1188732&r1=1188731&r2=1188732&view=diff
==
--- james/protocols/trunk/impl/pom.xml (original)
+++ james/protocols/trunk/impl/pom.xml Tue Oct 25 15:45:01 2011
@@ -17,16 +17,13 @@
 specific language governing permissions and limitations
 under the License.
 -->
-http://maven.apache.org/POM/4.0.0";
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
 
 protocols
 org.apache.james
-1.6-beta2-SNAPSHOT
+1.6-beta2
 ../pom.xml
 
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1188732&r1=1188731&r2=1188732&view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Tue Oct 25 15:45:01 2011
@@ -17,16 +17,13 @@
 specific language governing permissions and limitations
 under the License.
 -->
-http://maven.apache.org/POM/4.0.0";
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
 
 protocols
 org.apache.james
-1.6-beta2-SNAPSHOT
+1.6-beta2
 ../pom.xml
 
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1188732&r1=1188731&r2=1188732&view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Tue Oct 25 15:45:01 2011
@@ -17,22 +17,19 @@
 specific language governing permissions and limitations
 under the License.
 -->
-http://maven.apache.org/POM/4.0.0";
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 4.0.0
 
 
 james-project
 org.apache.james
 1.6
-
+
 
 
 org.apache.james
 protocols
-1.6-beta2-SNAPSHOT
+1.6-beta2
 pom
 
 Apache James Protocols
@@ -48,9 +45,9 @@
 
 
 
-
scm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk
-
scm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk
-
http://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN
+

[jira] [Resolved] (PROTOCOLS-40) Use geronimo as a dependency for javamail instead of oracle javamail so that we don't need "repositories" entry in pom.

2011-10-25 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTOCOLS-40?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved PROTOCOLS-40.


Resolution: Fixed

> Use geronimo as a dependency for javamail instead of oracle javamail so that 
> we don't need "repositories" entry in pom.
> ---
>
> Key: PROTOCOLS-40
> URL: https://issues.apache.org/jira/browse/PROTOCOLS-40
> Project: JAMES Protocols
>  Issue Type: Task
>Affects Versions: 1.5
>Reporter: Stefano Bagnara
>Assignee: Norman Maurer
> Fix For: 1.6-beta2
>
>
> This is a library project so we don't need to depend on an actual 
> implementation (like we do, instead, in james server), but only on the api, 
> and we can use api from geronimo.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1188727 - in /james/protocols/trunk: lmtp/pom.xml pom.xml smtp/pom.xml

2011-10-25 Thread norman
Author: norman
Date: Tue Oct 25 15:41:48 2011
New Revision: 1188727

URL: http://svn.apache.org/viewvc?rev=1188727&view=rev
Log:
Use geronimo as a dependency for javamail instead of oracle javamail so that we 
don't need "repositories" entry in pom. See PROTOCOLS-40

Modified:
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/smtp/pom.xml

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1188727&r1=1188726&r2=1188727&view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Tue Oct 25 15:41:48 2011
@@ -53,8 +53,8 @@
 apache-mailet
 
 
-javax.mail
-mail
+org.apache.geronimo.javamail
+geronimo-javamail_1.4_mail
 
 
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1188727&r1=1188726&r2=1188727&view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Tue Oct 25 15:41:48 2011
@@ -140,14 +140,14 @@
 
 
 
-javax.mail
-mail
-1.4.4
+org.apache.geronimo.specs
+geronimo-activation_1.1_spec
+1.0.2
 
 
-javax.activation
-activation
-1.1.1
+org.apache.geronimo.javamail
+geronimo-javamail_1.4_mail
+1.6
 
 
 commons-codec
@@ -168,16 +168,6 @@
 
 
 
-
-
-
-maven2-repository.dev.java.net
-Java.net Repository for Maven
-http://download.java.net/maven/2/
-default
-
-
-
 
 
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1188727&r1=1188726&r2=1188727&view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Tue Oct 25 15:41:48 2011
@@ -57,10 +57,9 @@
 apache-mailet
 
 
-javax.mail
-mail
+org.apache.geronimo.javamail
+geronimo-javamail_1.4_mail
 
-
 
 junit
 junit



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (PROTOCOLS-43) Upgrade netty 3.2.6.Final

2011-10-25 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTOCOLS-43?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved PROTOCOLS-43.


Resolution: Fixed

> Upgrade netty 3.2.6.Final
> -
>
> Key: PROTOCOLS-43
> URL: https://issues.apache.org/jira/browse/PROTOCOLS-43
> Project: JAMES Protocols
>  Issue Type: Task
>Affects Versions: 1.6-beta1
>    Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 1.6-beta2
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1188717 - /james/protocols/trunk/pom.xml

2011-10-25 Thread norman
Author: norman
Date: Tue Oct 25 15:33:41 2011
New Revision: 1188717

URL: http://svn.apache.org/viewvc?rev=1188717&view=rev
Log:
Upgrade to netty 3.2.6.Final. See PROTOCOLS-43

Modified:
james/protocols/trunk/pom.xml

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1188717&r1=1188716&r2=1188717&view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Tue Oct 25 15:33:41 2011
@@ -157,7 +157,7 @@
 
 org.jboss.netty
 netty
-3.2.4.Final
+3.2.6.Final
 
 
 junit



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1188715 - /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractSession.java

2011-10-25 Thread norman
Author: norman
Date: Tue Oct 25 15:32:42 2011
New Revision: 1188715

URL: http://svn.apache.org/viewvc?rev=1188715&view=rev
Log:
Fix warning

Modified:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractSession.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractSession.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractSession.java?rev=1188715&r1=1188714&r2=1188715&view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractSession.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractSession.java
 Tue Oct 25 15:32:42 2011
@@ -136,7 +136,6 @@ public abstract class AbstractSession im
 /**
  * @see org.apache.james.protocols.api.ProtocolSession#getState()
  */
-@SuppressWarnings("unchecked")
 public Map getState() {
 return sessionState;
 }



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (PROTOCOLS-43) Upgrade netty 3.2.6.Final

2011-10-25 Thread Norman Maurer (Created) (JIRA)
Upgrade netty 3.2.6.Final
-

 Key: PROTOCOLS-43
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-43
 Project: JAMES Protocols
  Issue Type: Task
Affects Versions: 1.6-beta1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6-beta2




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1188547 - /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java

2011-10-25 Thread norman
Author: norman
Date: Tue Oct 25 07:32:57 2011
New Revision: 1188547

URL: http://svn.apache.org/viewvc?rev=1188547&view=rev
Log:
Use ConcurrentLinkedQueue for the Responses as this is faster and also prevent 
deadlocks etc

Modified:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java?rev=1188547&r1=1188546&r2=1188547&view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
 Tue Oct 25 07:32:57 2011
@@ -21,8 +21,8 @@ package org.apache.james.protocols.api;
 
 import java.io.InputStream;
 import java.nio.charset.Charset;
-import java.util.LinkedList;
 import java.util.List;
+import java.util.concurrent.ConcurrentLinkedQueue;
 
 import org.apache.james.protocols.api.FutureResponse.ResponseListener;
 
@@ -41,20 +41,17 @@ public abstract class AbstractProtocolTr
 
 
 // TODO: Should we limit the size ?
-private final LinkedList responses = new LinkedList();
+private final ConcurrentLinkedQueue responses = new 
ConcurrentLinkedQueue();
 
 /**
  * @see 
org.apache.james.protocols.api.ProtocolTransport#writeResponse(org.apache.james.protocols.api.Response,
 org.apache.james.protocols.api.ProtocolSession)
  */
 public final void writeResponse(Response response, final ProtocolSession 
session) {
-synchronized (responses) {
-// just add the response to the queue. We will trigger the write 
operation later
-responses.add(response);
+// just add the response to the queue. We will trigger the write 
operation later
+responses.add(response);
  
-// trigger the write
-writeQueuedResponses(session);
-}
-
+// trigger the write
+writeQueuedResponses(session);
 }
 
 /**
@@ -66,38 +63,37 @@ public abstract class AbstractProtocolTr
  * @param session
  */
 private  void writeQueuedResponses(final ProtocolSession session) {
-synchronized (responses) {
-Response queuedResponse = null;
+Response queuedResponse = null;
 
-// dequeue Responses until non is left
-while ((queuedResponse = responses.poll()) != null) {
+// dequeue Responses until non is left
+while ((queuedResponse = responses.poll()) != null) {
 
-// check if we need to take special care of FutureResponses
-if (queuedResponse instanceof FutureResponse) {
-FutureResponse futureResponse =(FutureResponse) 
queuedResponse;
-if (futureResponse.isReady()) {
-// future is ready so we can write it without blocking 
the IO-Thread
-writeResponseToClient(queuedResponse, session);
-} else {
+// check if we need to take special care of FutureResponses
+if (queuedResponse instanceof FutureResponse) {
+FutureResponse futureResponse =(FutureResponse) queuedResponse;
+if (futureResponse.isReady()) {
+// future is ready so we can write it without blocking the 
IO-Thread
+writeResponseToClient(queuedResponse, session);
+} else {
 
-// future is not ready so we need to write it via a 
ResponseListener otherwise we MAY block the IO-Thread
-futureResponse.addListener(new ResponseListener() {
+// future is not ready so we need to write it via a 
ResponseListener otherwise we MAY block the IO-Thread
+futureResponse.addListener(new ResponseListener() {
 
-public void onResponse(FutureResponse response) {
-writeResponseToClient(response, session);
-writeQueuedResponses(session);
-}
-});
+public void onResponse(FutureResponse response) {
+writeResponseToClient(response, session);
+writeQueuedResponses(session);
+}
+});
 
-// just break here as we will trigger the dequeue later
-break;
-}
-
-  

[jira] [Resolved] (JAMES-1341) ImapRequestFrameDecoder should only try to decode frame if ImapSession.getState() != ImapSessionState.LOGOUT

2011-10-19 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1341.
--

Resolution: Fixed

> ImapRequestFrameDecoder should only try to decode frame if 
> ImapSession.getState() != ImapSessionState.LOGOUT
> 
>
> Key: JAMES-1341
> URL: https://issues.apache.org/jira/browse/JAMES-1341
> Project: JAMES Server
>  Issue Type: Improvement
>  Components: IMAPServer
>Affects Versions: 3.0-beta3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1186171 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java

2011-10-19 Thread norman
Author: norman
Date: Wed Oct 19 12:36:46 2011
New Revision: 1186171

URL: http://svn.apache.org/viewvc?rev=1186171&view=rev
Log:
ImapRequestFrameDecoder should only try to decode frame if 
ImapSession.getState() != ImapSessionState.LOGOUT. See JAMES-1341

Modified:

james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java

Modified: 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java?rev=1186171&r1=1186170&r2=1186171&view=diff
==
--- 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 (original)
+++ 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 Wed Oct 19 12:36:46 2011
@@ -30,6 +30,7 @@ import java.util.Map;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.james.imap.api.ImapMessage;
+import org.apache.james.imap.api.ImapSessionState;
 import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.decode.ImapRequestLineReader;
@@ -160,7 +161,8 @@ public class ImapRequestFrameDecoder ext
 ImapSession session = (ImapSession) attributes.get(channel);
 
 // check if the session was removed before to prevent a harmless NPE. 
See JAMES-1312
-if (session != null) {
+// Also check if the session was logged out if so there is not need to 
try to decode it. See JAMES-1341
+if (session != null && session.getState() != ImapSessionState.LOGOUT) {
 try {
 
 ImapMessage message = decoder.decode(reader, session);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1341) ImapRequestFrameDecoder should only try to decode frame if ImapSession.getState() != ImapSessionState.LOGOUT

2011-10-19 Thread Norman Maurer (Created) (JIRA)
ImapRequestFrameDecoder should only try to decode frame if 
ImapSession.getState() != ImapSessionState.LOGOUT


 Key: JAMES-1341
 URL: https://issues.apache.org/jira/browse/JAMES-1341
 Project: JAMES Server
  Issue Type: Improvement
  Components: IMAPServer
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 3.0-beta4




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1186159 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java

2011-10-19 Thread norman
Author: norman
Date: Wed Oct 19 12:26:28 2011
New Revision: 1186159

URL: http://svn.apache.org/viewvc?rev=1186159&view=rev
Log:
Check if the Channel is connected before write a message to it. See JAMES-1340

Modified:

james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java

Modified: 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java?rev=1186159&r1=1186158&r2=1186159&view=diff
==
--- 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
 (original)
+++ 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
 Wed Oct 19 12:26:28 2011
@@ -58,28 +58,34 @@ public class ChannelImapResponseWriter i
  * @see org.apache.james.imap.encode.ImapResponseWriter#write(byte[])
  */
 public void write(byte[] buffer) throws IOException {
-channel.write(ChannelBuffers.wrappedBuffer(buffer));
+if (channel.isConnected()) {
+channel.write(ChannelBuffers.wrappedBuffer(buffer));
+}
 }
 
 /**
  * @see 
org.apache.james.imap.encode.ImapResponseWriter#write(org.apache.james.imap.message.response.Literal)
  */
 public void write(Literal literal) throws IOException {
-InputStream in = literal.getInputStream();
-if (in instanceof FileInputStream && channel.getFactory() instanceof 
NioServerSocketChannelFactory) {
-FileChannel fc = ((FileInputStream) in).getChannel();
-// Zero-copy is only possible if no SSL/TLS  and no COMPRESS is in 
place
-//
-// See JAMES-1305 and JAMES-1306
-ChannelPipeline cp = channel.getPipeline();
-if (zeroCopy && cp.get(SslHandler.class) == null && 
cp.get(ZlibEncoder.class) == null ) {
-channel.write(new DefaultFileRegion(fc, fc.position(), 
literal.size()));
+if (channel.isConnected()) {
+InputStream in = literal.getInputStream();
+if (in instanceof FileInputStream && channel.getFactory() 
instanceof NioServerSocketChannelFactory) {
+FileChannel fc = ((FileInputStream) in).getChannel();
+   // Zero-copy is only possible if no SSL/TLS  and no 
COMPRESS is in place
+//
+// See JAMES-1305 and JAMES-1306
+ChannelPipeline cp = channel.getPipeline();
+if (zeroCopy && cp.get(SslHandler.class) == null && 
cp.get(ZlibEncoder.class) == null ) {
+channel.write(new DefaultFileRegion(fc, fc.position(), 
literal.size()));
+} else {
+channel.write(new ChunkedNioFile(fc, 8192));
+}
 } else {
-channel.write(new ChunkedNioFile(fc, 8192));
+channel.write(new ChunkedStream(literal.getInputStream()));
 }
-} else {
-channel.write(new ChunkedStream(literal.getInputStream()));
 }
 }
+
+
 
 }



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1340) ChannelImapResponseWriter should check if channel is connected before write to it

2011-10-19 Thread Norman Maurer (Created) (JIRA)
ChannelImapResponseWriter should check if channel is connected before write to 
it
-

 Key: JAMES-1340
 URL: https://issues.apache.org/jira/browse/JAMES-1340
 Project: JAMES Server
  Issue Type: Improvement
  Components: IMAPServer
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
Assignee: Norman Maurer
Priority: Minor
 Fix For: 3.0-beta4


At the moment we pass the object which should get written to the 
Channel.write(..) method and don't care if the channel is still connected. We 
should better first check if its connected as otherwise we will raise an 
exception later.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: svn commit: r1185997 - /james/project/trunk/pom.xml

2011-10-19 Thread Norman Maurer
We still have some project which are jdk 1.5... Do you plan to make
1.6 the default and override this on the others ?

Thanks,
Norman


2011/10/19  :
> Author: felixk
> Date: Wed Oct 19 07:01:27 2011
> New Revision: 1185997
>
> URL: http://svn.apache.org/viewvc?rev=1185997&view=rev
> Log:
> - Target JDK is 1-6
> - No need to generate test-javadocs for site generation, only javadocs are 
> needed to make them available from the site
>
> Modified:
>    james/project/trunk/pom.xml
>
> Modified: james/project/trunk/pom.xml
> URL: 
> http://svn.apache.org/viewvc/james/project/trunk/pom.xml?rev=1185997&r1=1185996&r2=1185997&view=diff
> ==
> --- james/project/trunk/pom.xml (original)
> +++ james/project/trunk/pom.xml Wed Oct 19 07:01:27 2011
> @@ -314,7 +314,7 @@
>
>     
>         UTF-8
> -        1.5
> +        1.6
>         1.7
>         
> ${basedir}/src/site
>         
> false
> @@ -753,7 +753,6 @@
>                         pre-site
>                         
>                             aggregate
> -                            test-aggregate
>                         
>                         
>                             256m
>
>
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Fwd: [ANNOUNCEMENT] Hadoop 0.20.205.0 release

2011-10-18 Thread Norman Maurer
I guess this is the answer to our hbase problem


bye
norman

-- Weitergeleitete Nachricht --
Von: Matt Foley
Datum: Dienstag, 18. Oktober 2011
Betreff: [ANNOUNCEMENT] Hadoop 0.20.205.0 release
An: gene...@hadoop.apache.org, common-u...@hadoop.apache.org,
common-...@hadoop.apache.org


On Friday 14 Oct, the Hadoop community voted ten to zero (including four PMC
members voting in favor) to accept the release of Hadoop 0.20.205.0.

The biggest feature of this release is that it merges the
append/hsync/hflush features of branch-0.20-append, and security features of
branch-0.20-security.  Therefore, this is the first official Apache Hadoop
release that supports HBase in secure mode!

Thanks to everyone who contributed bug fixes, merges, and improvements.  It
was truly a community effort.

Best regards,
--Matt (Release Manager)


Re: [VOTE] Release Apache James Skin 1.7

2011-10-18 Thread Norman Maurer
[x] +1 Please release

Thanks for taking care :)

Bye,
Norman


2011/10/18 Felix Knecht :
> Hi
>
> A list of changes/fixes:
> - Logos for James modules added (when existing)
> - Fancybox utility for image zooms under MIT licence added
> - Access javascript arrays via array.item(nr) instead of array[nr] because
> the cgi script doesn't likes words in square brackets (JAMES-1260)
> - Implement Apache Branding Requirements 3. Website Navigation Links: navbar
> links included, link to www.apache.org included -> need to update the left
> menu, putting the link to www.apache.org in bold (JAMES-1289)
> - Fix maven skin "download" tracking in order to support asynchronous google
> analytics code (the #googleAnalytics tag now includes the new code so that
> "urchinTrack" is not available anymore.
> - Rename artifact from maven-skin to james-skin (keep existing version)
> JAMES-1334)
> - Replace parent pom reference (JAMES-1334)
> - Cleanup pom and add needed definitions (JAMES-1334)
> - It's no longer a Maven2 but Maven3 skin (JAMES-1334)
>
> Please cast you vote for release Apache James Skin 1.7.
>
> Release for review:
> https://repository.apache.org/content/repositories/orgapachejames-073/
>
> [ ] +1 Please release
> [ ] +0 No time to review
> [ ] -1 Something wrong which blocks the release.
>
> Thanks and regards
> Felix
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (PROTOCOLS-42) LineHandlerUpstreamHandler does create byte arrays with wrong size when copy data

2011-10-16 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTOCOLS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved PROTOCOLS-42.


Resolution: Fixed

> LineHandlerUpstreamHandler does create byte arrays with wrong size when copy 
> data
> -
>
> Key: PROTOCOLS-42
> URL: https://issues.apache.org/jira/browse/PROTOCOLS-42
> Project: JAMES Protocols
>  Issue Type: Bug
>Affects Versions: 1.6-beta1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
>Priority: Minor
> Fix For: 1.6-beta2
>
>
> In the LineHandlerUpstreamHandler we create a new byte array which use 
> ChannelBuffer.capacity() for the length of it. This is wrong, we should use 
> ChannelBuffer.readableBytes(). Beside this we miss to respect the array 
> offset if we try to optimize things and don't copy the byte array

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (PROTOCOLS-42) LineHandlerUpstreamHandler does create byte arrays with wrong size when copy data

2011-10-16 Thread Norman Maurer (Created) (JIRA)
LineHandlerUpstreamHandler does create byte arrays with wrong size when copy 
data
-

 Key: PROTOCOLS-42
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-42
 Project: JAMES Protocols
  Issue Type: Bug
Affects Versions: 1.6-beta1
Reporter: Norman Maurer
Assignee: Norman Maurer
Priority: Minor
 Fix For: 1.6-beta2


In the LineHandlerUpstreamHandler we create a new byte array which use 
ChannelBuffer.capacity() for the length of it. This is wrong, we should use 
ChannelBuffer.readableBytes(). Beside this we miss to respect the array offset 
if we try to optimize things and don't copy the byte array

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1185015 - /james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/LineHandlerUpstreamHandler.java

2011-10-16 Thread norman
Author: norman
Date: Mon Oct 17 06:10:10 2011
New Revision: 1185015

URL: http://svn.apache.org/viewvc?rev=1185015&view=rev
Log:
LineHandlerUpstreamHandler does create byte arrays with wrong size when copy 
data. See PROTOCOLS-42

Modified:

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/LineHandlerUpstreamHandler.java

Modified: 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/LineHandlerUpstreamHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/LineHandlerUpstreamHandler.java?rev=1185015&r1=1185014&r2=1185015&view=diff
==
--- 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/LineHandlerUpstreamHandler.java
 (original)
+++ 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/LineHandlerUpstreamHandler.java
 Mon Oct 17 06:10:10 2011
@@ -48,10 +48,17 @@ public class LineHandlerUpstreamHandler<
 ChannelBuffer buf = (ChannelBuffer) e.getMessage();  
 byte[] line;
 if (buf.hasArray()) {
-line = buf.array();
+if (buf.arrayOffset() == 0 && buf.readableBytes() == 
buf.capacity()) {
+// we have no offset and the length is the same as the 
capacity. Its safe to reuse the array without copy it first
+line = buf.array();
+} else {
+// copy the ChannelBuffer to a byte array to process the 
LineHandler
+line = new byte[buf.readableBytes()];
+buf.getBytes(0, line);
+}
 } else {
 // copy the ChannelBuffer to a byte array to process the 
LineHandler
-line = new byte[buf.capacity()];
+line = new byte[buf.readableBytes()];
 buf.getBytes(0, line);
 }
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: James Server dies after few dayd

2011-10-15 Thread Norman Maurer
Hi there,

the problem is that I'm not a "windows guy" so I'm not sure how to
debug there. In linux I would first run "dmesg" to see if maybe the
jvm segfault. No idea if there is something similar in windows. The
other thing you could check is if you got an OOM. Add this to the
startup option of java:

-XX:-HeapDumpOnOutOfMemoryError


This will generate a heapdump if it exists because of an OOM.

Bye,
Norman


2011/10/15 Saibabu Vallurupalli :
> Hi Norman,
>
> So, Is this something to do with OS? Any other ideas to debug the issues?
> Please advise us with some directions.
>
> Thank you,
> Sai
>
>
>
> On Sat, Oct 15, 2011 at 8:22 AM, Norman Maurer > wrote:
>
>> Hi,
>>
>> Unfortunaly I never used windows for a production setup. So I guess I
>> can't help you much ...
>>
>> Bye
>> Norman
>>
>> 2011/10/15, Saibabu Vallurupalli :
>> > Hi Eric/Norman:
>> >
>> > Sorry the server we are using is Apache James 3.0 Beta 2. Do you have any
>> > known issues related to the issue we are getting.
>> >
>> > Let us know your thoughts.
>> >
>> > Thank you,
>> > Sai
>> >
>> > On Fri, Oct 14, 2011 at 1:19 PM, Saibabu Vallurupalli <
>> > saibabu.vallurupa...@gmail.com> wrote:
>> >
>> >> Hi Team,
>> >> We have recently upgraded our James server 3.1 beta2. Also, have got JPA
>> >> encryption fix on top of 0.3 version.
>> >> We are seening an issue with James windows setvice. It stops all of a
>> >> sudden with no complaints in server.log files.
>> >> Any ideas or suggestions to tackle this issue are greatly appreciated.
>> >>
>> >> Thank you,
>> >> Sai
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>
>>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: James Server dies after few dayd

2011-10-15 Thread Norman Maurer
Hi,

Unfortunaly I never used windows for a production setup. So I guess I
can't help you much ...

Bye
Norman

2011/10/15, Saibabu Vallurupalli :
> Hi Eric/Norman:
>
> Sorry the server we are using is Apache James 3.0 Beta 2. Do you have any
> known issues related to the issue we are getting.
>
> Let us know your thoughts.
>
> Thank you,
> Sai
>
> On Fri, Oct 14, 2011 at 1:19 PM, Saibabu Vallurupalli <
> saibabu.vallurupa...@gmail.com> wrote:
>
>> Hi Team,
>> We have recently upgraded our James server 3.1 beta2. Also, have got JPA
>> encryption fix on top of 0.3 version.
>> We are seening an issue with James windows setvice. It stops all of a
>> sudden with no complaints in server.log files.
>> Any ideas or suggestions to tackle this issue are greatly appreciated.
>>
>> Thank you,
>> Sai
>>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1183454 - /james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java

2011-10-14 Thread norman
Author: norman
Date: Fri Oct 14 18:27:08 2011
New Revision: 1183454

URL: http://svn.apache.org/viewvc?rev=1183454&view=rev
Log:
Start to implement remove method of FileMailQueue

Modified:

james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java

Modified: 
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java?rev=1183454&r1=1183453&r2=1183454&view=diff
==
--- 
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
 (original)
+++ 
james/server/trunk/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java
 Fri Oct 14 18:27:08 2011
@@ -59,31 +59,30 @@ import org.slf4j.Logger;
  */
 public class FileMailQueue implements ManageableMailQueue {
 
-private ConcurrentHashMap keyMappings = new 
ConcurrentHashMap();
-private BlockingQueue inmemoryQueue = new 
LinkedBlockingQueue();
-private ScheduledExecutorService scheduler = 
Executors.newSingleThreadScheduledExecutor();
+private final ConcurrentHashMap keyMappings = new 
ConcurrentHashMap();
+private final BlockingQueue inmemoryQueue = new 
LinkedBlockingQueue();
+private final ScheduledExecutorService scheduler = 
Executors.newSingleThreadScheduledExecutor();
 private final static AtomicLong COUNTER = new AtomicLong();
-private final String queuename;
-private final File parentDir;
-private String queueDirName;
+private final String queueDirName;
+private final File queueDir;
 private final Logger log;
-private boolean sync;
+
+private final boolean sync;
 private final static String MSG_EXTENSION = ".msg";
 private final static String OBJECT_EXTENSION = ".obj";
 private final static String NEXT_DELIVERY = "FileQueueNextDelivery";
 private final static int SPLITCOUNT = 10;
 
 public FileMailQueue(File parentDir, String queuename, boolean sync, 
Logger log) throws IOException {
-this.queuename = queuename;
-this.parentDir = parentDir;
 this.log = log;
 this.sync = sync;
+this.queueDir = new File(parentDir, queuename);
+this.queueDirName = queueDir.getAbsolutePath();
+
 init();
 }
 
 private void init() throws IOException {
-File queueDir = new File(parentDir, queuename);
-queueDirName = queueDir.getAbsolutePath();
 
 for (int i = 1; i <= SPLITCOUNT; i++) {
 File qDir = new File(queueDir, Integer.toString(i));
@@ -272,10 +271,11 @@ public class FileMailQueue implements Ma
 
 }
 final String key = k;
+final FileItem fitem = item;
 ObjectInputStream oin = null;
 try {
-final File objectFile = new File(item.getObjectFile());
-final File msgFile = new File(item.getMessageFile());
+final File objectFile = new File(fitem.getObjectFile());
+final File msgFile = new File(fitem.getMessageFile());
 oin = new ObjectInputStream(new FileInputStream(objectFile));
 final Mail mail = (Mail) oin.readObject();
 mail.setMessage(new MimeMessageCopyOnWriteProxy(new 
FileMimeMessageSource(msgFile)));
@@ -296,16 +296,7 @@ public class FileMailQueue implements Ma
 throw new MailQueueException("Unable to 
rollback", e);
 }
 } else {
-keyMappings.remove(key);
-if (!objectFile.delete()) {
-if (log.isInfoEnabled()) {
-log.info("Unable to delete file " + 
objectFile);
-}
-}
-if (!msgFile.delete()) {
-if (log.isInfoEnabled()) {
-log.info("Unable to delete file " + 
msgFile);
-}}
+fitem.delete();
 }
 
 LifecycleUtil.dispose(mail);
@@ -388,7 +379,7 @@ public class FileMailQueue implements Ma
  * 
  *
  */
-private final static class FileItem {
+private final class FileItem {
 private String objectfile;
 private String messagefile;
 
@@ -406,6 +397,23 @@ public class FileMailQueue implements Ma
 return messagefile;
 }
 
+public void delete() throws MailQueueException {
+File msgFile = new File(getMessageFile());
+File objectFil

svn commit: r1183448 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java

2011-10-14 Thread norman
Author: norman
Date: Fri Oct 14 18:02:17 2011
New Revision: 1183448

URL: http://svn.apache.org/viewvc?rev=1183448&view=rev
Log:
IdleProcessor does now remove "HeartbeatHandler" once IDLE was complete. See 
IMAP-348

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java?rev=1183448&r1=1183447&r2=1183448&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
 Fri Oct 14 18:02:17 2011
@@ -28,6 +28,7 @@ import java.util.Locale;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapSessionState;
@@ -86,6 +87,8 @@ public class IdleProcessor extends Abstr
 idleListener = null;
 }
 
+final AtomicBoolean idleActive = new AtomicBoolean(true);
+
 session.pushLineHandler(new ImapLineHandler() {
 
 /**
@@ -118,6 +121,7 @@ public class IdleProcessor extends Abstr
 okComplete(command, tag, responder);
 
 }
+idleActive.set(false);
 }
 });
 
@@ -128,7 +132,7 @@ public class IdleProcessor extends Abstr
 public void run() {
 // check if we need to cancel the Runnable
 // See IMAP-275
-if (session.getState() != ImapSessionState.LOGOUT) {
+if (session.getState() != ImapSessionState.LOGOUT && 
idleActive.get()) {
 // Send a heartbeat to the client to make sure we
 // reset the idle timeout. This is kind of the same
 // workaround as dovecot use.



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-348) IdleProcessor does not remove "HeartbeatHandler" once IDLE was complete

2011-10-14 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-348.


Resolution: Fixed

> IdleProcessor does not remove "HeartbeatHandler" once IDLE was complete
> ---
>
> Key: IMAP-348
> URL: https://issues.apache.org/jira/browse/IMAP-348
> Project: JAMES Imap
>  Issue Type: Bug
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> When a client issue the IDLE command we add a HeartbeadHandler which sends a 
> "keep alive message" every 2 minutes to make sure we don't run into timeouts 
> while waiting for events. The problem is that we miss to remove the Handler 
> once the client terminate IDLE by issue an DONE sequence.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (IMAP-348) IdleProcessor does not remove "HeartbeatHandler" once IDLE was complete

2011-10-14 Thread Norman Maurer (Created) (JIRA)
IdleProcessor does not remove "HeartbeatHandler" once IDLE was complete
---

 Key: IMAP-348
 URL: https://issues.apache.org/jira/browse/IMAP-348
 Project: JAMES Imap
  Issue Type: Bug
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


When a client issue the IDLE command we add a HeartbeadHandler which sends a 
"keep alive message" every 2 minutes to make sure we don't run into timeouts 
while waiting for events. The problem is that we miss to remove the Handler 
once the client terminate IDLE by issue an DONE sequence.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[RESULT] [VOTE] Release Apache James Mime4j 0.7.1

2011-10-12 Thread Norman Maurer
Hi,

the vote passed with:

+1 Manuel, Eric, Robert, Norman
+0 Ioan

Thanks for everyone who voted. I will push the release to maven
central and the apache mirrors later today.

Bye,
Norman


2011/10/8 Norman Maurer :
> Hi there,
>
> its time for first patch release of the 0.7 series. Please cast you
> vote for release Apache James Mime4j 0.7.1.
>
> A list of fixes are here:
> https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.1%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESC&mode=hide
>
> Release for review:
> https://repository.apache.org/content/repositories/orgapachejames-045/
>
> [ ] +1 Please release
> [ ] +0 No time to review
> [ ] -1 Something wrong which blocks the release.
>
>
> Thanks,
> Norman
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1333) Minimize ExecutionHandler default size

2011-10-12 Thread Norman Maurer (Created) (JIRA)
Minimize ExecutionHandler default size
--

 Key: JAMES-1333
 URL: https://issues.apache.org/jira/browse/JAMES-1333
 Project: JAMES Server
  Issue Type: Task
  Components: IMAPServer, POP3Server, SMTPServer
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 3.0-beta4


At the moment we use 50 which is quite to high for most enviroments. Better 
would be to set it to somthing like 16.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1333) Minimize ExecutionHandler default size

2011-10-12 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1333.
--

Resolution: Fixed

> Minimize ExecutionHandler default size
> --
>
> Key: JAMES-1333
> URL: https://issues.apache.org/jira/browse/JAMES-1333
> Project: JAMES Server
>  Issue Type: Task
>  Components: IMAPServer, POP3Server, SMTPServer
>Affects Versions: 3.0-beta3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>
> At the moment we use 50 which is quite to high for most enviroments. Better 
> would be to set it to somthing like 16.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1182677 - /james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java

2011-10-12 Thread norman
Author: norman
Date: Thu Oct 13 06:16:56 2011
New Revision: 1182677

URL: http://svn.apache.org/viewvc?rev=1182677&view=rev
Log:
Set the maxExecutionHandler to 16. See JAMES-1333

Modified:

james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java

Modified: 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java?rev=1182677&r1=1182676&r2=1182677&view=diff
==
--- 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 (original)
+++ 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 Thu Oct 13 06:16:56 2011
@@ -58,10 +58,10 @@ import org.slf4j.Logger;
  */
 public abstract class AbstractConfigurableAsyncServer extends 
AbstractAsyncServer implements LogEnabled, Configurable, ServerMBean {
 /** The default value for the connection backlog. */
-private static final int DEFAULT_BACKLOG = 200;
+public static final int DEFAULT_BACKLOG = 200;
 
 /** The default value for the connection timeout. */
-private static final int DEFAULT_TIMEOUT = 5 * 60;
+public static final int DEFAULT_TIMEOUT = 5 * 60;
 
 /** The name of the parameter defining the connection timeout. */
 private static final String TIMEOUT_NAME = "connectiontimeout";
@@ -72,6 +72,8 @@ public abstract class AbstractConfigurab
 /** The name of the parameter defining the service hello name. */
 public static final String HELLO_NAME = "helloName";
 
+public static final int DEFAULT_MAX_EXECUTOR_COUNT = 16;
+
 // By default, use the Sun X509 algorithm that comes with the Sun JCE
 // provider for SSL
 // certificates
@@ -114,6 +116,7 @@ public abstract class AbstractConfigurab
 private MBeanServer mbeanServer;
 
 
+
 @Resource(name = "filesystem")
 public final void setFileSystem(FileSystem filesystem) {
 this.fileSystem = filesystem;
@@ -193,7 +196,7 @@ public abstract class AbstractConfigurab
 int ioWorker = config.getInt("ioWorkerCount", DEFAULT_IO_WORKER_COUNT);
 setIoWorkerCount(ioWorker);
 
-maxExecutorThreads = config.getInt("maxExecutorCount", 50);
+maxExecutorThreads = config.getInt("maxExecutorCount", 
DEFAULT_MAX_EXECUTOR_COUNT);
 
 
 configureHelloName(config);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1332) IMAPServer does not reset idle-timeout one IDLE heartbeats

2011-10-12 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1332.
--

Resolution: Fixed

> IMAPServer does not reset idle-timeout one IDLE heartbeats
> --
>
> Key: JAMES-1332
> URL: https://issues.apache.org/jira/browse/JAMES-1332
> Project: JAMES Server
>  Issue Type: Bug
>  Components: IMAPServer
>Affects Versions: 3.0-beta3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>
> While "IDLE" is active we send heartbeats to make sure the connection is not 
> timed-out. Unfortunally we miss to reset the idle timeout once such a 
> heartbeat is send. This needs to get fixed

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1332) IMAPServer does not reset idle-timeout one IDLE heartbeats

2011-10-12 Thread Norman Maurer (Created) (JIRA)
IMAPServer does not reset idle-timeout one IDLE heartbeats
--

 Key: JAMES-1332
 URL: https://issues.apache.org/jira/browse/JAMES-1332
 Project: JAMES Server
  Issue Type: Bug
  Components: IMAPServer
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 3.0-beta4


While "IDLE" is active we send heartbeats to make sure the connection is not 
timed-out. Unfortunally we miss to reset the idle timeout once such a heartbeat 
is send. This needs to get fixed

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1182417 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java

2011-10-12 Thread norman
Author: norman
Date: Wed Oct 12 15:08:23 2011
New Revision: 1182417

URL: http://svn.apache.org/viewvc?rev=1182417&view=rev
Log:
Reset idle-timeout one IDLE heartbeats. See JAMES-1332

Modified:

james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java

Modified: 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java?rev=1182417&r1=1182416&r2=1182417&view=diff
==
--- 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
 (original)
+++ 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
 Wed Oct 12 15:08:23 2011
@@ -130,7 +130,7 @@ public class IMAPServer extends Abstract
 public ChannelPipeline getPipeline() throws Exception {
 ChannelPipeline pipeline = pipeline();
 pipeline.addLast(GROUP_HANDLER, groupHandler);
-pipeline.addLast("idleHandler", new IdleStateHandler(timer, 0, 
30, TIMEOUT, TIMEOUT_UNIT));
+pipeline.addLast("idleHandler", new IdleStateHandler(timer, 0, 
0, TIMEOUT, TIMEOUT_UNIT));
 pipeline.addLast(TIMEOUT_HANDLER, new ImapIdleStateHandler());
 pipeline.addLast(CONNECTION_LIMIT_HANDLER, new 
ConnectionLimitUpstreamHandler(IMAPServer.this.connectionLimit));
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1331) Expose stats for the ExecutionHandler ThreadPool via JMX

2011-10-12 Thread Norman Maurer (Created) (JIRA)
Expose stats for the ExecutionHandler ThreadPool via JMX


 Key: JAMES-1331
 URL: https://issues.apache.org/jira/browse/JAMES-1331
 Project: JAMES Server
  Issue Type: Improvement
  Components: IMAPServer, POP3Server, SMTPServer
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 3.0-beta4


As we use an ExecutionHandler to hand of blocking task to another threadpool it 
would be nice to expose some jmx stats fo it. This allows for better monitoring

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1331) Expose stats for the ExecutionHandler ThreadPool via JMX

2011-10-12 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1331.
--

Resolution: Fixed

done

> Expose stats for the ExecutionHandler ThreadPool via JMX
> 
>
> Key: JAMES-1331
> URL: https://issues.apache.org/jira/browse/JAMES-1331
> Project: JAMES Server
>  Issue Type: Improvement
>  Components: IMAPServer, POP3Server, SMTPServer
>Affects Versions: 3.0-beta3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>
> As we use an ExecutionHandler to hand of blocking task to another threadpool 
> it would be nice to expose some jmx stats fo it. This allows for better 
> monitoring

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1182416 - /james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/

2011-10-12 Thread norman
Author: norman
Date: Wed Oct 12 15:03:52 2011
New Revision: 1182416

URL: http://svn.apache.org/viewvc?rev=1182416&view=rev
Log:
Expose stats for the ExecutionHandler ThreadPool via JMX. See JMAES-1331

Added:

james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/JMXEnabledOrderedMemoryAwareThreadPoolExecutor.java
   (with props)

james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/JMXEnabledOrderedMemoryAwareThreadPoolExecutorMBean.java
   (with props)
Modified:

james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java

Modified: 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java?rev=1182416&r1=1182415&r2=1182416&view=diff
==
--- 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 (original)
+++ 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 Wed Oct 12 15:03:52 2011
@@ -51,7 +51,6 @@ import org.jboss.netty.channel.ChannelPi
 import org.jboss.netty.channel.ChannelUpstreamHandler;
 import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.handler.execution.ExecutionHandler;
-import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
 import org.slf4j.Logger;
 
 /**
@@ -114,6 +113,7 @@ public abstract class AbstractConfigurab
 
 private MBeanServer mbeanServer;
 
+
 @Resource(name = "filesystem")
 public final void setFileSystem(FileSystem filesystem) {
 this.fileSystem = filesystem;
@@ -473,14 +473,18 @@ public abstract class AbstractConfigurab
 return connectionLimit;
 }
 
+protected String getThreadPoolJMXPath() {
+return "org.apache.james:type=server,name=" + jmxName + 
",sub-type=threadpool";
+}
+
 @Override
 protected Executor createBossExecutor() {
-return 
JMXEnabledThreadPoolExecutor.newCachedThreadPool("org.apache.james:type=server,name="
 + jmxName + ",sub-type=threadpool", "boss");
+return 
JMXEnabledThreadPoolExecutor.newCachedThreadPool(getThreadPoolJMXPath(), 
"boss");
 }
 
 @Override
 protected Executor createWorkerExecutor() {
-return 
JMXEnabledThreadPoolExecutor.newCachedThreadPool("org.apache.james:type=server,name="
 + jmxName + ",sub-type=threadpool", "worker");
+return 
JMXEnabledThreadPoolExecutor.newCachedThreadPool(getThreadPoolJMXPath(), 
"worker");
 }
 
 /**
@@ -570,7 +574,7 @@ public abstract class AbstractConfigurab
  * @return ehandler
  */
 protected ExecutionHandler createExecutionHander() {
-return new ExecutionHandler(new 
OrderedMemoryAwareThreadPoolExecutor(maxExecutorThreads, 0, 0));
+return new ExecutionHandler(new 
JMXEnabledOrderedMemoryAwareThreadPoolExecutor(maxExecutorThreads, 0, 0, 
getThreadPoolJMXPath(), "executor"));
 }
 
 /**

Added: 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/JMXEnabledOrderedMemoryAwareThreadPoolExecutor.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/JMXEnabledOrderedMemoryAwareThreadPoolExecutor.java?rev=1182416&view=auto
==
--- 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/JMXEnabledOrderedMemoryAwareThreadPoolExecutor.java
 (added)
+++ 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/JMXEnabledOrderedMemoryAwareThreadPoolExecutor.java
 Wed Oct 12 15:03:52 2011
@@ -0,0 +1,163 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless

[jira] [Resolved] (MAILBOX-151) AbstractDelegatingMailboxListeners should release locks faster

2011-10-11 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved MAILBOX-151.
---

Resolution: Fixed

> AbstractDelegatingMailboxListeners should release locks faster
> --
>
> Key: MAILBOX-151
> URL: https://issues.apache.org/jira/browse/MAILBOX-151
> Project: James Mailbox
>  Issue Type: Improvement
>  Components: store
>Affects Versions: 0.3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.4
>
>
> In AbstractDelegatingMailboxListeners.event(...) we do a very bad job in 
> releasing the locks in a timely manner, as we execute the whole 
> MailboxListener.event(...) calls in the synchronized block. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1330) MimeMessageInputStreamSource should keep bytes in memory till a threshould is exceed

2011-10-11 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1330.
--

Resolution: Fixed

> MimeMessageInputStreamSource should keep bytes in memory till a threshould is 
> exceed
> 
>
> Key: JAMES-1330
> URL: https://issues.apache.org/jira/browse/JAMES-1330
> Project: JAMES Server
>  Issue Type: Improvement
>  Components: James Core
>Affects Versions: 3.0-beta3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>
> At the moment we store the content of the MimeMessageInputStreamSource in a 
> temporary file even if its only a few bytes. This is used for temporary store 
> the message content till the SMTP Client does end the DATA sequence with a 
> CRLF.CRLF. This slow down things as we need to write to disk for every line 
> we receive. It would be better to keep things in memory till a threshould is 
> hit. I think 100kb is a good one as it should be enought for 90 % of emails 
> and the other 10 % can just get temporary stored on disk

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1181908 - /james/server/trunk/core/src/main/java/org/apache/james/core/MimeMessageInputStreamSource.java

2011-10-11 Thread norman
Author: norman
Date: Tue Oct 11 17:39:32 2011
New Revision: 1181908

URL: http://svn.apache.org/viewvc?rev=1181908&view=rev
Log:
MimeMessageInputStreamSource should keep bytes in memory till a threshould is 
exceed. See JAMES-1330

Modified:

james/server/trunk/core/src/main/java/org/apache/james/core/MimeMessageInputStreamSource.java

Modified: 
james/server/trunk/core/src/main/java/org/apache/james/core/MimeMessageInputStreamSource.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/core/src/main/java/org/apache/james/core/MimeMessageInputStreamSource.java?rev=1181908&r1=1181907&r2=1181908&view=diff
==
--- 
james/server/trunk/core/src/main/java/org/apache/james/core/MimeMessageInputStreamSource.java
 (original)
+++ 
james/server/trunk/core/src/main/java/org/apache/james/core/MimeMessageInputStreamSource.java
 Tue Oct 11 17:39:32 2011
@@ -20,16 +20,16 @@
 package org.apache.james.core;
 
 import javax.mail.MessagingException;
+import javax.mail.util.SharedByteArrayInputStream;
 import javax.mail.util.SharedFileInputStream;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.output.DeferredFileOutputStream;
 import org.apache.james.lifecycle.api.Disposable;
 
-import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -39,21 +39,17 @@ import java.util.List;
 /**
  * Takes an input stream and creates a repeatable input stream source for a
  * MimeMessageWrapper. It does this by completely reading the input stream and
- * saving that to a temporary file that should delete on exit, or when this
- * object is GC'd.
+ * saving that to data to an {@link DeferredFileOutputStream} with its 
threshold set to 100kb
  * 
- * @see MimeMessageWrapper
- */
+ **/
 public class MimeMessageInputStreamSource extends MimeMessageSource implements 
Disposable {
 
 private final List streams = new ArrayList();
 
-private OutputStream out;
-
 /**
  * A temporary file used to hold the message stream
  */
-private File file;
+private DeferredFileOutputStream out;
 
 /**
  * The full path of the temporary file
@@ -61,6 +57,16 @@ public class MimeMessageInputStreamSourc
 private String sourceId;
 
 /**
+ * 100kb threshold for the stream.
+ */
+private final static int THRESHOLD = 1024 * 100;
+
+/**
+ * Temporary directory to use
+ */
+private final static File TMPDIR = new 
File(System.getProperty("java.io.tmpdir"));
+
+/**
  * Construct a new MimeMessageInputStreamSource from an
  * InputStream that contains the bytes of a MimeMessage.
  * 
@@ -76,18 +82,21 @@ public class MimeMessageInputStreamSourc
 super();
 // We want to immediately read this into a temporary file
 // Create a temp file and channel the input stream into it
-OutputStream fout = null;
 try {
-file = File.createTempFile(key, ".m64");
-fout = new BufferedOutputStream(new FileOutputStream(file));
-IOUtils.copy(in, fout);
-sourceId = file.getCanonicalPath();
+out = new DeferredFileOutputStream(THRESHOLD, key, ".m64", TMPDIR 
);
+IOUtils.copy(in, out);
+sourceId = key;
 } catch (IOException ioe) {
 throw new MessagingException("Unable to retrieve the data: " + 
ioe.getMessage(), ioe);
 } finally {
 try {
-if (fout != null) {
-fout.close();
+if (out != null) {
+out.close();
+
+File file = out.getFile();
+if (file != null) {
+file.delete();
+}
 }
 } catch (IOException ioe) {
 // Ignored - logging unavailable to log this non-fatal error.
@@ -100,31 +109,14 @@ public class MimeMessageInputStreamSourc
 } catch (IOException ioe) {
 // Ignored - logging unavailable to log this non-fatal error.
 }
-
-// if sourceId is null while file is not null then we had
-// an IOxception and we have to clean the file.
-if (sourceId == null && file != null) {
-// No need to throw an IOException when unable to delete as 
it's a temporary file
-file.delete();
-}
+
 }
 }
 
 public MimeMessageInputStreamSource(String key) throws MessagingException {
 super();
-try {
-file = File.createTempFile(key, ".m64");
-sourceId = file.getCanonicalPath();
-  

[jira] [Created] (JAMES-1330) MimeMessageInputStreamSource should keep bytes in memory till a threshould is exceed

2011-10-11 Thread Norman Maurer (Created) (JIRA)
MimeMessageInputStreamSource should keep bytes in memory till a threshould is 
exceed


 Key: JAMES-1330
 URL: https://issues.apache.org/jira/browse/JAMES-1330
 Project: JAMES Server
  Issue Type: Improvement
  Components: James Core
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 3.0-beta4


At the moment we store the content of the MimeMessageInputStreamSource in a 
temporary file even if its only a few bytes. This is used for temporary store 
the message content till the SMTP Client does end the DATA sequence with a 
CRLF.CRLF. This slow down things as we need to write to disk for every line we 
receive. It would be better to keep things in memory till a threshould is hit. 
I think 100kb is a good one as it should be enought for 90 % of emails and the 
other 10 % can just get temporary stored on disk

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (MAILBOX-151) AbstractDelegatingMailboxListeners should release locks faster

2011-10-10 Thread Norman Maurer (Created) (JIRA)
AbstractDelegatingMailboxListeners should release locks faster
--

 Key: MAILBOX-151
 URL: https://issues.apache.org/jira/browse/MAILBOX-151
 Project: James Mailbox
  Issue Type: Improvement
  Components: store
Affects Versions: 0.3
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.4


In AbstractDelegatingMailboxListeners.event(...) we do a very bad job in 
releasing the locks in a timely manner, as we execute the whole 
MailboxListener.event(...) calls in the synchronized block. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1181144 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

2011-10-10 Thread norman
Author: norman
Date: Mon Oct 10 19:13:46 2011
New Revision: 1181144

URL: http://svn.apache.org/viewvc?rev=1181144&view=rev
Log:
Don't lock mailbox longer then necessary...

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1181144&r1=1181143&r2=1181144&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Mon Oct 10 19:13:46 2011
@@ -78,7 +78,8 @@ public class SelectedMailboxImpl impleme
 private boolean isDeletedByOtherSession = false;
 private boolean sizeChanged = false;
 private boolean silentFlagChanges = false;
-private Flags applicableFlags;
+private final Flags applicableFlags = new Flags(FLAGS);
+
 private boolean applicableFlagsChanged;
 
 private final SortedMap msnToUid =new TreeMap();;
@@ -101,23 +102,24 @@ public class SelectedMailboxImpl impleme
 }
  
 
-private synchronized void init() throws MailboxException {
+private void init() throws MailboxException {
 MailboxSession mailboxSession = 
ImapSessionUtils.getMailboxSession(session);
 
 mailboxManager.addListener(path, this, mailboxSession);
 
 MessageResultIterator messages = mailboxManager.getMailbox(path, 
mailboxSession).getMessages(MessageRange.all(), FetchGroupImpl.MINIMAL, 
mailboxSession);
-Flags applicableFlags = new Flags(FLAGS);
-while(messages.hasNext()) {
-MessageResult mr = messages.next();
-applicableFlags.add(mr.getFlags());
-add(mr.getUid());
+synchronized (this) {
+while(messages.hasNext()) {
+MessageResult mr = messages.next();
+applicableFlags.add(mr.getFlags());
+add(mr.getUid());
+}
+
+  
+// \RECENT is not a applicable flag in imap so remove it from the 
list
+applicableFlags.remove(Flags.Flag.RECENT);
 }
-
-  
-// \RECENT is not a applicable flag in imap so remove it from the list
-applicableFlags.remove(Flags.Flag.RECENT);
-this.applicableFlags = applicableFlags;
+   
 }
 
 private void add(int msn, long uid) {



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (PROTOCOLS-41) Don't try log hostname on connect/disconnect

2011-10-10 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTOCOLS-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved PROTOCOLS-41.


Resolution: Fixed

done

> Don't try log hostname on connect/disconnect
> 
>
> Key: PROTOCOLS-41
> URL: https://issues.apache.org/jira/browse/PROTOCOLS-41
> Project: JAMES Protocols
>  Issue Type: Improvement
>Affects Versions: 1.6-beta1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 1.6-beta2
>
>
> At the moment we log the ipaddress and hostname on each connect/disconnect. 
> This may need a reverse dns lookup and so keeps the io-thread busy. We should 
> just lok the ipaddress as this is most times what people care about. This 
> will speed up things

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1181115 - /james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java

2011-10-10 Thread norman
Author: norman
Date: Mon Oct 10 18:28:43 2011
New Revision: 1181115

URL: http://svn.apache.org/viewvc?rev=1181115&view=rev
Log:
Don't try log hostname on connect/disconnect. See PROTOCOLS-41

Modified:

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java

Modified: 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java?rev=1181115&r1=1181114&r2=1181115&view=diff
==
--- 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java
 (original)
+++ 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java
 Mon Oct 10 18:28:43 2011
@@ -89,7 +89,7 @@ public class BasicChannelUpstreamHandler
 List connectHandlers = 
chain.getHandlers(ConnectHandler.class);
 List resultHandlers = 
chain.getHandlers(ProtocolHandlerResultHandler.class);
 ProtocolSession session = (ProtocolSession) ctx.getAttachment();
-session.getLogger().info("Connection established from " + 
session.getRemoteHost() + " (" + session.getRemoteIPAddress()+ ")");
+session.getLogger().info("Connection established from " + 
session.getRemoteIPAddress());
 if (connectHandlers != null) {
 for (int i = 0; i < connectHandlers.size(); i++) {
 ConnectHandler cHandler = connectHandlers.get(i);
@@ -183,7 +183,7 @@ public class BasicChannelUpstreamHandler
 public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) 
throws Exception {
 ProtocolSession session = (ProtocolSession) ctx.getAttachment();
 if (session != null) {
-session.getLogger().info("Connection closed for " + 
session.getRemoteHost() + " (" + session.getRemoteIPAddress()+ ")");
+session.getLogger().info("Connection closed for " + 
session.getRemoteIPAddress());
 }
 cleanup(ctx);
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (PROTOCOLS-41) Don't try log hostname on connect/disconnect

2011-10-10 Thread Norman Maurer (Created) (JIRA)
Don't try log hostname on connect/disconnect


 Key: PROTOCOLS-41
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-41
 Project: JAMES Protocols
  Issue Type: Improvement
Affects Versions: 1.6-beta1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6-beta2


At the moment we log the ipaddress and hostname on each connect/disconnect. 
This may need a reverse dns lookup and so keeps the io-thread busy. We should 
just lok the ipaddress as this is most times what people care about. This will 
speed up things

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Updated] (PROTOCOLS-40) Use geronimo as a dependency for javamail instead of oracle javamail so that we don't need "repositories" entry in pom.

2011-10-10 Thread Norman Maurer (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTOCOLS-40?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer updated PROTOCOLS-40:
---

Fix Version/s: (was: 1.6-beta1)
   1.6-beta2

> Use geronimo as a dependency for javamail instead of oracle javamail so that 
> we don't need "repositories" entry in pom.
> ---
>
> Key: PROTOCOLS-40
> URL: https://issues.apache.org/jira/browse/PROTOCOLS-40
> Project: JAMES Protocols
>  Issue Type: Task
>Affects Versions: 1.5
>Reporter: Stefano Bagnara
>Assignee: Norman Maurer
> Fix For: 1.6-beta2
>
>
> This is a library project so we don't need to depend on an actual 
> implementation (like we do, instead, in james server), but only on the api, 
> and we can use api from geronimo.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (IMAP-347) FetchProcessor should skip messages that can't get parsed

2011-10-10 Thread Norman Maurer (Created) (JIRA)
FetchProcessor should skip messages that can't get parsed
-

 Key: IMAP-347
 URL: https://issues.apache.org/jira/browse/IMAP-347
 Project: JAMES Imap
  Issue Type: Bug
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


In FetchProcessor we build the FetchResponse per requested message. This may 
for whatever reason. In this case we error out and return a BAD response to the 
client. This is not a very good way to handle it. We should better skip the 
message and log it. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-347) FetchProcessor should skip messages that can't get parsed

2011-10-10 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-347.


Resolution: Fixed

done

> FetchProcessor should skip messages that can't get parsed
> -
>
> Key: IMAP-347
> URL: https://issues.apache.org/jira/browse/IMAP-347
> Project: JAMES Imap
>  Issue Type: Bug
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> In FetchProcessor we build the FetchResponse per requested message. This may 
> for whatever reason. In this case we error out and return a BAD response to 
> the client. This is not a very good way to handle it. We should better skip 
> the message and log it. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1181108 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java

2011-10-10 Thread norman
Author: norman
Date: Mon Oct 10 18:11:39 2011
New Revision: 1181108

URL: http://svn.apache.org/viewvc?rev=1181108&view=rev
Log:
FetchProcessor should skip messages that can't get parsed. See IMAP-347

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java?rev=1181108&r1=1181107&r2=1181108&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
 Mon Oct 10 18:11:39 2011
@@ -172,6 +172,14 @@ public class FetchProcessor extends Abst
 if (session.getLog().isDebugEnabled()) {
 session.getLog().debug("Unable to find message with 
uid " + result.getUid(), e);
 }
+} catch (MailboxException e) {
+// we can't for whatever reason find parse all requested 
parts of the message. This may because it was deleted while try to access the 
parts.
+// So we just skip it 
+//
+// See IMAP-347
+if (session.getLog().isDebugEnabled()) {
+session.getLog().debug("Unable to fetch message with 
uid " + result.getUid() + ", so skip it", e);
+}
 }
 }
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1181103 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java

2011-10-10 Thread norman
Author: norman
Date: Mon Oct 10 18:04:47 2011
New Revision: 1181103

URL: http://svn.apache.org/viewvc?rev=1181103&view=rev
Log:
Don't log the hostname as it needs a reverse lookup and so slow down things. 
See JAMES-1329

Modified:

james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java

Modified: 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java?rev=1181103&r1=1181102&r2=1181103&view=diff
==
--- 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
 (original)
+++ 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
 Mon Oct 10 18:04:47 2011
@@ -98,7 +98,7 @@ public class ImapChannelUpstreamHandler 
 @Override
 public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) 
throws Exception {
 InetSocketAddress address = (InetSocketAddress) 
ctx.getChannel().getRemoteAddress();
-getLogger(ctx.getChannel()).info("Connection closed for " + 
address.getHostName() + " (" + address.getAddress().getHostAddress() + ")");
+getLogger(ctx.getChannel()).info("Connection closed for " + 
address.getAddress().getHostAddress());
 
 // remove the stored attribute for the channel to free up resources
 // See JAMES-1195
@@ -112,7 +112,7 @@ public class ImapChannelUpstreamHandler 
 @Override
 public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent 
e) throws Exception {
 InetSocketAddress address = (InetSocketAddress) 
ctx.getChannel().getRemoteAddress();
-getLogger(ctx.getChannel()).info("Connection established from " + 
address.getHostName() + " (" + address.getAddress().getHostAddress() + ")");
+getLogger(ctx.getChannel()).info("Connection established from " + 
address.getAddress().getHostAddress());
 
 ImapResponseComposer response = new ImapResponseComposerImpl(new 
ChannelImapResponseWriter(ctx.getChannel()));
 ctx.setAttachment(response);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1329) ImapChannelUpstreamHandler should not do a reverse lookup for logging

2011-10-10 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1329.
--

Resolution: Fixed
  Assignee: Norman Maurer

fixed

> ImapChannelUpstreamHandler should not do a reverse lookup for logging
> -
>
> Key: JAMES-1329
> URL: https://issues.apache.org/jira/browse/JAMES-1329
> Project: JAMES Server
>  Issue Type: Improvement
>  Components: IMAPServer
>Affects Versions: 3.0-beta3
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>
> In ImapChannelUpstreamHandler we log the ipaddress and the hostname for each 
> connect/disconnect. This is a waste of resources as for the hostname java 
> needs todo a reverse lookup which unnecessary can block the boss/worker 
> thread of netty.
> To speed up things we should only log the ipaddress.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1329) ImapChannelUpstreamHandler should not do a reverse lookup for logging

2011-10-10 Thread Norman Maurer (Created) (JIRA)
ImapChannelUpstreamHandler should not do a reverse lookup for logging
-

 Key: JAMES-1329
 URL: https://issues.apache.org/jira/browse/JAMES-1329
 Project: JAMES Server
  Issue Type: Improvement
  Components: IMAPServer
Affects Versions: 3.0-beta3
Reporter: Norman Maurer
 Fix For: 3.0-beta4


In ImapChannelUpstreamHandler we log the ipaddress and the hostname for each 
connect/disconnect. This is a waste of resources as for the hostname java needs 
todo a reverse lookup which unnecessary can block the boss/worker thread of 
netty.

To speed up things we should only log the ipaddress.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180841 - /james/server/trunk/pom.xml

2011-10-10 Thread norman
Author: norman
Date: Mon Oct 10 09:31:05 2011
New Revision: 1180841

URL: http://svn.apache.org/viewvc?rev=1180841&view=rev
Log:
Move to protocols 1.6-beta1 as it was just released

Modified:
james/server/trunk/pom.xml

Modified: james/server/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=1180841&r1=1180840&r2=1180841&view=diff
==
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Mon Oct 10 09:31:05 2011
@@ -1437,7 +1437,7 @@
 0.4-SNAPSHOT
 0.3-SNAPSHOT
 ${project.version}
-1.6-SNAPSHOT
+1.6-beta1
 0.4
 2.2.5
 0.90.3



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

2011-10-09 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-424?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-424.
-

Resolution: Won't Fix

I think we are ok with what we are doing atm

> Invalid DATA for Message shows up in Headers in mailstore
> -
>
> Key: JAMES-424
> URL: https://issues.apache.org/jira/browse/JAMES-424
> Project: JAMES Server
>  Issue Type: Improvement
>  Components: SMTPServer
>Affects Versions: 2.2.0
> Environment: WinXP
>Reporter: Scott Carr
>Assignee: Norman Maurer
>Priority: Minor
> Fix For: Trunk
>
> Attachments: headerFix.diff
>
>
> If you open a connection to the server, and send in the following in the DATA 
> for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it 
> should.  Here is what I recieved in the message:
> Return-Path: 
> Received: from localhost ([127.0.0.1])
>   by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>   for ;
>   Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.c...@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <2758093.1128652823167.JavaMail.Administrator@QRGMAIN>
> Notice where 'this is a test' appears in the message.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1032) wildcard (*) in servername

2011-10-09 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1032.
--

Resolution: Won't Fix
  Assignee: Norman Maurer

After thinking about this we should not do this. As this brings all kind of 
problems.

> wildcard (*) in servername
> --
>
> Key: JAMES-1032
> URL: https://issues.apache.org/jira/browse/JAMES-1032
> Project: JAMES Server
>  Issue Type: New Feature
>  Components: James Core
>Reporter: Shahid
>Assignee: Norman Maurer
> Fix For: 3.0
>
>
> allow wildcard (*) in servername to handle sub-domains.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180688 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

2011-10-09 Thread norman
Author: norman
Date: Sun Oct  9 18:59:12 2011
New Revision: 1180688

URL: http://svn.apache.org/viewvc?rev=1180688&view=rev
Log:
First unregister listener on deselect then release resources

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1180688&r1=1180687&r2=1180688&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Sun Oct  9 18:59:12 2011
@@ -195,12 +195,6 @@ public class SelectedMailboxImpl impleme
 
 @Override
 public synchronized void deselect() {
-uidToMsn.clear();
-msnToUid.clear();
-flagUpdateUids.clear();
-
-expungedUids.clear();
-recentUids.clear();
 MailboxSession mailboxSession = 
ImapSessionUtils.getMailboxSession(session);
 
 try {
@@ -210,6 +204,14 @@ public class SelectedMailboxImpl impleme
 session.getLog().info("Unable to remove listener " + this + " 
from mailbox while closing it", e);
 }
 }
+
+uidToMsn.clear();
+msnToUid.clear();
+flagUpdateUids.clear();
+
+expungedUids.clear();
+recentUids.clear();
+ 
 
 }
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: Cut Apache James Mailbox 0.4-beta1 ?

2011-10-09 Thread Norman Maurer
yeah maybe as I can not see another problem. Please retry with latest
snapshot.

thanks
norman

Am Sonntag, 9. Oktober 2011 schrieb Eric Charles :
> In my case, I don't think it is caused by a concurrent session having
deleted the message.
>
> I would need to further debug, but message was in the subfolder on disk
and was not deleted. Maybe moved from a thunderbird filter moving a message
from INBOX to a that subfolder...
>
> Thx,
> Eric
>
> On 09/10/11 19:39, Norman Maurer wrote:
>
> Hi there,
>
> at least we will now ignore such problems as it may happen because of
> concurrent sessions.
>
> See https://issues.apache.org/jira/browse/IMAP-346
>
> Anyway that does not explain your problem. I would like to debug this
> futher as the message seems to be clearly there.
>
> Bye,
> Norman
>
>
> 2011/10/9 Norman Maurer:
>
> Hm...
>
> Can you include the full stacktrace ?
>
> 2011/10/9 Eric Charles:
>
> mmh, I now see stacktraces with messages such as:
>
> org.apache.james.mailbox.MailboxException: No message found with uid 52589
> at
>
org.apache.james.imap.processor.StoreProcessor.setFlags(StoreProcessor.java:281)
>
> if I grep 52589 james-uidlist, I get
> 52589 1318174914.64925dcb914212291293.srv002,S=4962:2,S
>
> more cur/1318174914.64925dcb914212291293.srv002,S=4962:2,S
> shows me a valid mail.
>
> Thunderbird does not complain like yesterday "unable to select folder",
but
> fails to 'repair' the folder where I get such messages (it silently fails
> after fetching a few messages).
>
> Back to older bet4 snapshot.
>
> hugh,
> eric
>
>
> On 09/10/11 18:07, Eric Charles wrote:
>
> I gave a try to today snapshot, and migration is now OK (no more issue).
> Thx for the fix Norman!
> I will commit tomorrow to log with error.
>
> I will further monitor for correct operation, but it seems like mailbox
> is good here for release.
>
> Thx,
> Eric
>
> On 08/10/11 20:33, Norman Maurer wrote:
>
> And this for more graceful handling:
>
> https://issues.apache.org/jira/browse/IMAP-345
>
> Bye,
> Norman
>
>
> 2011/10/8 Norman Maurer:
>
> You are right...
>
> Loglevel adjusted :)
>
> https://issues.apache.org/jira/browse/IMAP-343
>
> Bye,
> Norman
>
> 2011/10/8 Eric Charles:
>
> yes, maildir.
>
> I already had such issue selecting a mailbox.
> Removing james-uidlist james-uidvalidity made it work.
> If I remember well, we are now skipping any invalid line in the
> uidlist.
>
> This time, remove these files didn't help, this is why I raised the log
> level
>
> Eric
>
> On 08/10/11 18:10, Norman Maurer wrote:
>
> Interesting...
>
> I will have a look later. what mailbox format you use ? maildir ?
>
> Bye,
> Norman
>
>
> 2011/10/8 Eric Charles:
>
> Hi,
> The spring for hbase is OK (maybe not exactly what we wanted, but
> still
> acceptable).
>
> I just tried to migrate to latest snapshot to validate protocols, but
> felt
> on an issue ("unable to select folder"). After raising log level
> for imap
> to
> debug:
>
> org.apache.james.mailbox.MailboxException: No message found with
> uid 505
> in
> mailbox #private.INBOX.james-apache-org
> at
>
>
>
org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>
> at
>
>
>
org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>
> at
>
>
>
org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
>
> at
>
>
> I don't know if this is related to a local bad
> config/manipulation, to
> imap,
> to mailbox?
>


svn commit: r1180670 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

2011-10-09 Thread norman
Author: norman
Date: Sun Oct  9 17:53:46 2011
New Revision: 1180670

URL: http://svn.apache.org/viewvc?rev=1180670&view=rev
Log:
Declare some fields final

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1180670&r1=1180669&r2=1180670&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Sun Oct  9 17:53:46 2011
@@ -50,15 +50,15 @@ import org.apache.james.mailbox.UpdatedF
  */
 public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
 
-private final Set recentUids;
+private final Set recentUids = new TreeSet();
 
-private boolean recentUidRemoved;
+private boolean recentUidRemoved = false;
 
 private MailboxManager mailboxManager;
 
 private MailboxPath path;
 
-private ImapSession session;
+private final ImapSession session;
 
 
 private final static Flags FLAGS = new Flags();
@@ -71,9 +71,9 @@ public class SelectedMailboxImpl impleme
 }
 
 private final long sessionId;
-private Set flagUpdateUids;
-private Flags.Flag uninterestingFlag;
-private Set expungedUids;
+private final Set flagUpdateUids = new TreeSet();;
+private final Flags.Flag uninterestingFlag = Flags.Flag.RECENT;
+private final Set expungedUids = new TreeSet();
 
 private boolean isDeletedByOtherSession = false;
 private boolean sizeChanged = false;
@@ -81,33 +81,22 @@ public class SelectedMailboxImpl impleme
 private Flags applicableFlags;
 private boolean applicableFlagsChanged;
 
-private SortedMap msnToUid;
+private final SortedMap msnToUid =new TreeMap();;
 
-private SortedMap uidToMsn;
+private final SortedMap uidToMsn = new TreeMap();
 
 private long highestUid = 0;
 
 private int highestMsn = 0;
 
 public SelectedMailboxImpl(final MailboxManager mailboxManager, final 
ImapSession session, final MailboxPath path) throws MailboxException {
-recentUids = new TreeSet();
-recentUidRemoved = false;
 this.session = session;
 this.sessionId = 
ImapSessionUtils.getMailboxSession(session).getSessionId();
-flagUpdateUids = new TreeSet();
-expungedUids = new TreeSet();
-uninterestingFlag = Flags.Flag.RECENT;
 this.mailboxManager = mailboxManager;
 
 // Ignore events from our session
 setSilentFlagChanges(true);
 this.path = path;
-this.session = session;
-
-msnToUid = new TreeMap();
-uidToMsn = new TreeMap();
-
-
 init();
 }
  
@@ -210,7 +199,6 @@ public class SelectedMailboxImpl impleme
 msnToUid.clear();
 flagUpdateUids.clear();
 
-uninterestingFlag = null;
 expungedUids.clear();
 recentUids.clear();
 MailboxSession mailboxSession = 
ImapSessionUtils.getMailboxSession(session);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180668 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

2011-10-09 Thread norman
Author: norman
Date: Sun Oct  9 17:49:47 2011
New Revision: 1180668

URL: http://svn.apache.org/viewvc?rev=1180668&view=rev
Log:
Better init of uid<->msn mapping

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1180668&r1=1180667&r2=1180668&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Sun Oct  9 17:49:47 2011
@@ -103,6 +103,10 @@ public class SelectedMailboxImpl impleme
 setSilentFlagChanges(true);
 this.path = path;
 this.session = session;
+
+msnToUid = new TreeMap();
+uidToMsn = new TreeMap();
+
 
 init();
 }
@@ -112,28 +116,13 @@ public class SelectedMailboxImpl impleme
 MailboxSession mailboxSession = 
ImapSessionUtils.getMailboxSession(session);
 
 mailboxManager.addListener(path, this, mailboxSession);
-
 
-int msn = 1;
-msnToUid = new TreeMap();
-uidToMsn = new TreeMap();
-
-
- 
 MessageResultIterator messages = mailboxManager.getMailbox(path, 
mailboxSession).getMessages(MessageRange.all(), FetchGroupImpl.MINIMAL, 
mailboxSession);
 Flags applicableFlags = new Flags(FLAGS);
-List uids = new ArrayList();
 while(messages.hasNext()) {
 MessageResult mr = messages.next();
 applicableFlags.add(mr.getFlags());
-uids.add(mr.getUid());
-final Long uid = mr.getUid();
-highestUid = uid.longValue();
-highestMsn = msn;
-msnToUid.put(msn, uid);
-uidToMsn.put(uid, msn);
-
-msn++;
+add(mr.getUid());
 }
 
   



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[RESULT] [VOTE] Apache James Protocols 1.6-beta1

2011-10-09 Thread Norman Maurer
Hi there,

the VOTE passed:

+1 Manuel, Stefano, Norman (all binding)
+0 Ioan

Thanks again for all that voted. I will push the rlease to maven
central and to the mirrors.

Bye,
Norman

2011/10/6 Norman Maurer :
> Hi there,
>
> its time again to cut another Apache James Protocols release a.k.a 1.6-beta1.
>
> The release includes many changes which allows to make the
> implementation independent of the transport etc. We also moved the
> lmtp code in there to make it easier to write an "light-weight" lmtp
> server without the need to depend on many james server code.
>
> So please review and cast your vote:
> https://repository.apache.org/content/repositories/orgapachejames-037/
>
> [ ] +1 Yes please release
> [ ] +0 No time to review
> [ ] -1 Something is not right and we need to fix it first
>
> Thanks,
> Norman
>
> Ps: This release will be used for the upcomming Apache James Server
> 3.0-beta4 release
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180663 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java

2011-10-09 Thread norman
Author: norman
Date: Sun Oct  9 17:40:48 2011
New Revision: 1180663

URL: http://svn.apache.org/viewvc?rev=1180663&view=rev
Log:
Skip messages in response which were not found in msn<->uid mappings. See 
IMAP-346

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java?rev=1180663&r1=1180662&r2=1180663&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
 Sun Oct  9 17:40:48 2011
@@ -234,15 +234,14 @@ abstract public class AbstractMailboxPro
 int msn = selected.msn(uid);
 if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
 if (session.getLog().isDebugEnabled()) {
-if(session.getLog().isDebugEnabled()) {
-session.getLog().debug("No message found with uid " + 
uid + " in the uid<->msn mapping for mailbox " + 
selected.getPath().getFullName(mailboxSession.getPathDelimiter()) +" , this may 
be because it was deleted by a concurrent session. So skip it..");
-
-}
-// skip this as it was not found in the mapping
-// 
-// See IMAP-346
-continue;
-}
+session.getLog().debug("No message found with uid " + uid 
+ " in the uid<->msn mapping for mailbox " + 
selected.getPath().getFullName(mailboxSession.getPathDelimiter()) +" , this may 
be because it was deleted by a concurrent session. So skip it..");
+}  
+
+
+// skip this as it was not found in the mapping
+// 
+// See IMAP-346
+continue;
 }
 
 boolean qresyncEnabled = 
EnableProcessor.getEnabledCapabilities(session).contains(ImapConstants.SUPPORTS_QRESYNC);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: Cut Apache James Mailbox 0.4-beta1 ?

2011-10-09 Thread Norman Maurer
Hi there,

at least we will now ignore such problems as it may happen because of
concurrent sessions.

See https://issues.apache.org/jira/browse/IMAP-346

Anyway that does not explain your problem. I would like to debug this
futher as the message seems to be clearly there.

Bye,
Norman


2011/10/9 Norman Maurer :
> Hm...
>
> Can you include the full stacktrace ?
>
> 2011/10/9 Eric Charles :
>> mmh, I now see stacktraces with messages such as:
>>
>> org.apache.james.mailbox.MailboxException: No message found with uid 52589
>> at
>> org.apache.james.imap.processor.StoreProcessor.setFlags(StoreProcessor.java:281)
>>
>> if I grep 52589 james-uidlist, I get
>> 52589 1318174914.64925dcb914212291293.srv002,S=4962:2,S
>>
>> more cur/1318174914.64925dcb914212291293.srv002,S=4962:2,S
>> shows me a valid mail.
>>
>> Thunderbird does not complain like yesterday "unable to select folder", but
>> fails to 'repair' the folder where I get such messages (it silently fails
>> after fetching a few messages).
>>
>> Back to older bet4 snapshot.
>>
>> hugh,
>> eric
>>
>>
>> On 09/10/11 18:07, Eric Charles wrote:
>>>
>>> I gave a try to today snapshot, and migration is now OK (no more issue).
>>> Thx for the fix Norman!
>>> I will commit tomorrow to log with error.
>>>
>>> I will further monitor for correct operation, but it seems like mailbox
>>> is good here for release.
>>>
>>> Thx,
>>> Eric
>>>
>>> On 08/10/11 20:33, Norman Maurer wrote:
>>>>
>>>> And this for more graceful handling:
>>>>
>>>> https://issues.apache.org/jira/browse/IMAP-345
>>>>
>>>> Bye,
>>>> Norman
>>>>
>>>>
>>>> 2011/10/8 Norman Maurer:
>>>>>
>>>>> You are right...
>>>>>
>>>>> Loglevel adjusted :)
>>>>>
>>>>> https://issues.apache.org/jira/browse/IMAP-343
>>>>>
>>>>> Bye,
>>>>> Norman
>>>>>
>>>>> 2011/10/8 Eric Charles:
>>>>>>
>>>>>> yes, maildir.
>>>>>>
>>>>>> I already had such issue selecting a mailbox.
>>>>>> Removing james-uidlist james-uidvalidity made it work.
>>>>>> If I remember well, we are now skipping any invalid line in the
>>>>>> uidlist.
>>>>>>
>>>>>> This time, remove these files didn't help, this is why I raised the log
>>>>>> level
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>> On 08/10/11 18:10, Norman Maurer wrote:
>>>>>>>
>>>>>>> Interesting...
>>>>>>>
>>>>>>> I will have a look later. what mailbox format you use ? maildir ?
>>>>>>>
>>>>>>> Bye,
>>>>>>> Norman
>>>>>>>
>>>>>>>
>>>>>>> 2011/10/8 Eric Charles:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>> The spring for hbase is OK (maybe not exactly what we wanted, but
>>>>>>>> still
>>>>>>>> acceptable).
>>>>>>>>
>>>>>>>> I just tried to migrate to latest snapshot to validate protocols, but
>>>>>>>> felt
>>>>>>>> on an issue ("unable to select folder"). After raising log level
>>>>>>>> for imap
>>>>>>>> to
>>>>>>>> debug:
>>>>>>>>
>>>>>>>> org.apache.james.mailbox.MailboxException: No message found with
>>>>>>>> uid 505
>>>>>>>> in
>>>>>>>> mailbox #private.INBOX.james-apache-org
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>

[jira] [Resolved] (IMAP-346) Skip messages in response which were not found in msn<->uid mappings

2011-10-09 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-346.


Resolution: Fixed
  Assignee: Norman Maurer

done

> Skip messages in response which were not found in msn<->uid mappings
> 
>
> Key: IMAP-346
> URL: https://issues.apache.org/jira/browse/IMAP-346
> Project: JAMES Imap
>  Issue Type: Bug
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> Each SelectedMailbox has some msn<->uid mapping in cache to make it quick to 
> convert between the two. At the moment we throw an MailboxException if we can 
> not get the uid or msn for the given uid/msn. This is wrong in a few cases as 
> it may happen that another concurrent session deleted the message with the 
> uid/msn in the meantime while we create our response. In this case we should 
> just skip it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180661 - in /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor: AbstractMailboxProcessor.java StoreProcessor.java

2011-10-09 Thread norman
Author: norman
Date: Sun Oct  9 17:38:18 2011
New Revision: 1180661

URL: http://svn.apache.org/viewvc?rev=1180661&view=rev
Log:
Skip messages in response which were not found in msn<->uid mappings. See 
IMAP-346

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java?rev=1180661&r1=1180660&r2=1180661&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
 Sun Oct  9 17:38:18 2011
@@ -232,8 +232,18 @@ abstract public class AbstractMailboxPro
 MessageResult mr = it.next();
 final long uid = mr.getUid();
 int msn = selected.msn(uid);
-if (msn == SelectedMailbox.NO_SUCH_MESSAGE)
-throw new MailboxException("No message found with uid " + uid);
+if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
+if (session.getLog().isDebugEnabled()) {
+if(session.getLog().isDebugEnabled()) {
+session.getLog().debug("No message found with uid " + 
uid + " in the uid<->msn mapping for mailbox " + 
selected.getPath().getFullName(mailboxSession.getPathDelimiter()) +" , this may 
be because it was deleted by a concurrent session. So skip it..");
+
+}
+// skip this as it was not found in the mapping
+// 
+// See IMAP-346
+continue;
+}
+}
 
 boolean qresyncEnabled = 
EnableProcessor.getEnabledCapabilities(session).contains(ImapConstants.SUPPORTS_QRESYNC);
 boolean condstoreEnabled = 
EnableProcessor.getEnabledCapabilities(session).contains(ImapConstants.SUPPORTS_CONDSTORE);

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java?rev=1180661&r1=1180660&r2=1180661&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
 Sun Oct  9 17:38:18 2011
@@ -277,8 +277,16 @@ public class StoreProcessor extends Abst
 final long uid = entry.getKey();
 final int msn = selected.msn(uid);
 
-if (msn == SelectedMailbox.NO_SUCH_MESSAGE)
-throw new MailboxException("No message found with uid " + 
uid);
+if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
+if(session.getLog().isDebugEnabled()) {
+session.getLog().debug("No message found with uid " + 
uid + " in the uid<->msn mapping for mailbox " + 
selected.getPath().getFullName(mailboxSession.getPathDelimiter()) +" , this may 
be because it was deleted by a concurrent session. So skip it..");
+
+}
+// skip this as it was not found in the mapping
+// 
+// See IMAP-346
+continue;
+}
 
 final Flags resultFlags = entry.getValue();
 final Long resultUid;



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (IMAP-346) Skip messages in response which were not found in msn<->uid mappings

2011-10-09 Thread Norman Maurer (Created) (JIRA)
Skip messages in response which were not found in msn<->uid mappings


 Key: IMAP-346
 URL: https://issues.apache.org/jira/browse/IMAP-346
 Project: JAMES Imap
  Issue Type: Bug
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
 Fix For: 0.3


Each SelectedMailbox has some msn<->uid mapping in cache to make it quick to 
convert between the two. At the moment we throw an MailboxException if we can 
not get the uid or msn for the given uid/msn. This is wrong in a few cases as 
it may happen that another concurrent session deleted the message with the 
uid/msn in the meantime while we create our response. In this case we should 
just skip it.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: [VOTE] Release Apache James Mime4j 0.7.1

2011-10-09 Thread Norman Maurer
[ x ] +1 Please release

Bye,
Norman



2011/10/8 Norman Maurer :
> Hi there,
>
> its time for first patch release of the 0.7 series. Please cast you
> vote for release Apache James Mime4j 0.7.1.
>
> A list of fixes are here:
> https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.1%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESC&mode=hide
>
> Release for review:
> https://repository.apache.org/content/repositories/orgapachejames-045/
>
> [ ] +1 Please release
> [ ] +0 No time to review
> [ ] -1 Something wrong which blocks the release.
>
>
> Thanks,
> Norman
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: Cut Apache James Mailbox 0.4-beta1 ?

2011-10-09 Thread Norman Maurer
Hm...

Can you include the full stacktrace ?

2011/10/9 Eric Charles :
> mmh, I now see stacktraces with messages such as:
>
> org.apache.james.mailbox.MailboxException: No message found with uid 52589
> at
> org.apache.james.imap.processor.StoreProcessor.setFlags(StoreProcessor.java:281)
>
> if I grep 52589 james-uidlist, I get
> 52589 1318174914.64925dcb914212291293.srv002,S=4962:2,S
>
> more cur/1318174914.64925dcb914212291293.srv002,S=4962:2,S
> shows me a valid mail.
>
> Thunderbird does not complain like yesterday "unable to select folder", but
> fails to 'repair' the folder where I get such messages (it silently fails
> after fetching a few messages).
>
> Back to older bet4 snapshot.
>
> hugh,
> eric
>
>
> On 09/10/11 18:07, Eric Charles wrote:
>>
>> I gave a try to today snapshot, and migration is now OK (no more issue).
>> Thx for the fix Norman!
>> I will commit tomorrow to log with error.
>>
>> I will further monitor for correct operation, but it seems like mailbox
>> is good here for release.
>>
>> Thx,
>> Eric
>>
>> On 08/10/11 20:33, Norman Maurer wrote:
>>>
>>> And this for more graceful handling:
>>>
>>> https://issues.apache.org/jira/browse/IMAP-345
>>>
>>> Bye,
>>> Norman
>>>
>>>
>>> 2011/10/8 Norman Maurer:
>>>>
>>>> You are right...
>>>>
>>>> Loglevel adjusted :)
>>>>
>>>> https://issues.apache.org/jira/browse/IMAP-343
>>>>
>>>> Bye,
>>>> Norman
>>>>
>>>> 2011/10/8 Eric Charles:
>>>>>
>>>>> yes, maildir.
>>>>>
>>>>> I already had such issue selecting a mailbox.
>>>>> Removing james-uidlist james-uidvalidity made it work.
>>>>> If I remember well, we are now skipping any invalid line in the
>>>>> uidlist.
>>>>>
>>>>> This time, remove these files didn't help, this is why I raised the log
>>>>> level
>>>>>
>>>>> Eric
>>>>>
>>>>> On 08/10/11 18:10, Norman Maurer wrote:
>>>>>>
>>>>>> Interesting...
>>>>>>
>>>>>> I will have a look later. what mailbox format you use ? maildir ?
>>>>>>
>>>>>> Bye,
>>>>>> Norman
>>>>>>
>>>>>>
>>>>>> 2011/10/8 Eric Charles:
>>>>>>>
>>>>>>> Hi,
>>>>>>> The spring for hbase is OK (maybe not exactly what we wanted, but
>>>>>>> still
>>>>>>> acceptable).
>>>>>>>
>>>>>>> I just tried to migrate to latest snapshot to validate protocols, but
>>>>>>> felt
>>>>>>> on an issue ("unable to select folder"). After raising log level
>>>>>>> for imap
>>>>>>> to
>>>>>>> debug:
>>>>>>>
>>>>>>> org.apache.james.mailbox.MailboxException: No message found with
>>>>>>> uid 505
>>>>>>> in
>>>>>>> mailbox #private.INBOX.james-apache-org
>>>>>>> at
>>>>>>>
>>>>>>>
>>>>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>>>>>>>
>>>>>>> at
>>>>>>>
>>>>>>>
>>>>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>>>>>>>
>>>>>>> at
>>>>>>>
>>>>>>>
>>>>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
>>>>>>>
>>>>>>> at
>>>>>>>
>>>>>>>
>>>>>>> I don't know if this is related to a local bad
>>>>>>> config/manipulation, to
>>>>>>> imap,
>>>>>>> to mailbox?
>>>>>>>
>>>>>>> I will retry a migration to latest snapshot tomorrow.
>>>>>>>
>>>>>>> Thx.
>>>>>>>
>>>>>>>
>>>>>>> On 08/10/11 16:52, Norma

[jira] [Updated] (IMAP-328) Better handle concurrent FETCH and EXPUNGE

2011-10-09 Thread Norman Maurer (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer updated IMAP-328:
---

Fix Version/s: 0.3

Let us fix this for 0.3

> Better handle concurrent FETCH and EXPUNGE
> --
>
> Key: IMAP-328
> URL: https://issues.apache.org/jira/browse/IMAP-328
> Project: JAMES Imap
>  Issue Type: Improvement
>Affects Versions: 0.2.1
>    Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> At the moment it MAY be possible for clients which do "slow" FETCHES to fail 
> during stream the message content back to the client of another client (or 
> session) EXPUNGE the same message at the same time. From a talk at ##imap 
> (freenode irc) other IMAP Server implementations handle this kind of stuff 
> more sensible (like dovecot and cyrus). 
> There are a few options to handle this kind of stuff:
> 1) Lock the mailbox during FETCH and block EXPUNGE until its done
> 2) Only do a "pseudo" expunge and add it to some "commitlog" which will get 
> executed when the FETCH is done. To be 100 % sure its necessary to store it 
> permanet but I think in most cases a in memory representation MAY be enough 
> I think 2) is the way to go

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-344) Call Logger.is*Enabled() before pass it to the logger

2011-10-09 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-344.


Resolution: Fixed

was done on saturday

> Call Logger.is*Enabled() before pass it to the logger
> -
>
> Key: IMAP-344
> URL: https://issues.apache.org/jira/browse/IMAP-344
> Project: JAMES Imap
>  Issue Type: Improvement
>Affects Versions: 0.2.1
>    Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> We should call Logger.is*Enabled() before pass the to be logged value to the 
> logger

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: svn commit: r1180423 - in /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor: ./ fetch/

2011-10-09 Thread Norman Maurer
true enough

feel free to adjust

bye
norman

Am Sonntag, 9. Oktober 2011 schrieb Eric Charles :
> What about logging with error (getLog().error(...)).
> error will also be shown with INFO level.
>
> The HumanReadableText relate to FAILURE, so that sounds more like an
error...
>
> WDYT?
>
> Eric
>
>
> On 08/10/11 19:42, nor...@apache.org wrote:
>
> Author: norman
> Date: Sat Oct  8 17:42:39 2011
> New Revision: 1180423
>
> URL: http://svn.apache.org/viewvc?rev=1180423&view=rev
> Log:
> Log "fatal" MailboxExceptions via info level. See IMAP-343
>
> Modified:
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AppendProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CloseProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CopyProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CreateProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/DeleteProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/EnableProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ExpungeProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LogoutProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SubscribeProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/UnsubscribeProcessor.java
>
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
>
> Modified:
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
> URL:
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java?rev=1180423&r1=1180422&r2=1180423&view=diff
>
==
> ---
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
(original)
> +++
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
Sat Oct  8 17:42:39 2011
> @@ -90,7 +90,7 @@ public abstract class AbstractAuthProces
>  }
>  }
>  } catch (MailboxException e) {
> -session.getLog().debug("Login failed", e);
> +session.getLog().info("Login failed", e);
>  no(command, tag, responder,
HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING);
>  }
>  }
>
> Modified:
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
>
> --
> Eric
> http://about.echarles.net
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>


Re: Cut Apache James Mailbox 0.4-beta1 ?

2011-10-08 Thread Norman Maurer
And this for more graceful handling:

https://issues.apache.org/jira/browse/IMAP-345

Bye,
Norman


2011/10/8 Norman Maurer :
> You are right...
>
> Loglevel adjusted :)
>
> https://issues.apache.org/jira/browse/IMAP-343
>
> Bye,
> Norman
>
> 2011/10/8 Eric Charles :
>> yes, maildir.
>>
>> I already had such issue selecting a mailbox.
>> Removing james-uidlist james-uidvalidity made it work.
>> If I remember well, we are now skipping any invalid line in the uidlist.
>>
>> This time, remove these files didn't help, this is why I raised the log
>> level
>>
>> Eric
>>
>> On 08/10/11 18:10, Norman Maurer wrote:
>>>
>>> Interesting...
>>>
>>> I will have a look later. what mailbox format you use ? maildir ?
>>>
>>> Bye,
>>> Norman
>>>
>>>
>>> 2011/10/8 Eric Charles:
>>>>
>>>> Hi,
>>>> The spring for hbase is OK (maybe not exactly what we wanted, but still
>>>> acceptable).
>>>>
>>>> I just tried to migrate to latest snapshot to validate protocols, but
>>>> felt
>>>> on an issue ("unable to select folder"). After raising log level for imap
>>>> to
>>>> debug:
>>>>
>>>> org.apache.james.mailbox.MailboxException: No message found with uid 505
>>>> in
>>>> mailbox #private.INBOX.james-apache-org
>>>>   at
>>>>
>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>>>>   at
>>>>
>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>>>>   at
>>>>
>>>> org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
>>>>   at
>>>>
>>>>
>>>> I don't know if this is related to a local bad config/manipulation, to
>>>> imap,
>>>> to mailbox?
>>>>
>>>> I will retry a migration to latest snapshot tomorrow.
>>>>
>>>> Thx.
>>>>
>>>>
>>>> On 08/10/11 16:52, Norman Maurer wrote:
>>>>>
>>>>> Hi there,
>>>>>
>>>>> anything left before we cut Apache James Mailbox 0.4-beta1 ?
>>>>>
>>>>> @Eric:
>>>>> Anything resolved with the spring stuff ?
>>>>>
>>>>> Bye,
>>>>> Norman
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>>>>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>>>>
>>>>
>>>> --
>>>> Eric
>>>> http://about.echarles.net
>>>>
>>>> -
>>>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>>>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>>>
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>>
>>
>> --
>> Eric
>> http://about.echarles.net
>>
>> -
>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>
>>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-345) AbstractSelectionProcessor.unseen(..) may throws MailboxException if the message was deleted by an other session

2011-10-08 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-345.


Resolution: Fixed

> AbstractSelectionProcessor.unseen(..) may throws MailboxException if the 
> message was deleted by an other session
> 
>
> Key: IMAP-345
> URL: https://issues.apache.org/jira/browse/IMAP-345
> Project: JAMES Imap
>  Issue Type: Bug
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> See this exception:
> org.apache.james.mailbox.MailboxException: No message found with uid 505 in 
> mailbox #private.INBOX.james-apache-org
>   at 
> org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>   at 
> org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>   at 
> org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
>   at
> We should better retry to get the first unseen in this case and only error 
> out if we not was able to get it within x tries.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180448 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java

2011-10-08 Thread norman
Author: norman
Date: Sat Oct  8 18:32:35 2011
New Revision: 1180448

URL: http://svn.apache.org/viewvc?rev=1180448&view=rev
Log:
Better handling of concurrent modification while writing back the "UNSEEN" 
message. See IMAP-345

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java?rev=1180448&r1=1180447&r2=1180448&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
 Sat Oct  8 18:32:35 2011
@@ -121,12 +121,31 @@ abstract class AbstractSelectionProcesso
 
 final MessageManager.MetaData metaData = 
selectMailbox(fullMailboxPath, session);
 final SelectedMailbox selected = session.getSelected();
-
+Long firstUnseen = metaData.getFirstUnseen();
+
 flags(responder, selected);
 exists(responder, metaData);
 recent(responder, selected);
 uidValidity(responder, metaData);
-unseen(responder, metaData, selected, 
ImapSessionUtils.getMailboxSession(session));
+
+
+// try to write the UNSEEN message to the client and retry if we fail 
because of concurrent sessions.
+// 
+// See IMAP-345
+int retryCount = 0;
+while(unseen(responder, firstUnseen, selected, 
ImapSessionUtils.getMailboxSession(session)) == false) {
+// if we not was able to get find the unseen within 5 retries we 
should just not send it
+if (retryCount == 5) {
+if (session.getLog().isInfoEnabled()) {
+session.getLog().info("Unable to uid for unseen message " 
+ firstUnseen + " in mailbox " + selected.getPath());
+}
+break;
+}
+firstUnseen = selectMailbox(fullMailboxPath, 
session).getFirstUnseen();
+retryCount++;
+
+}
+
 permanentFlags(responder, metaData, selected);
 highestModSeq(responder, metaData, selected);
 uidNext(responder, metaData);
@@ -342,18 +361,23 @@ abstract class AbstractSelectionProcesso
 responder.respond(taggedOk);
 }
 
-private void unseen(Responder responder, MessageManager.MetaData metaData, 
final SelectedMailbox selected, MailboxSession session) throws MailboxException 
{
-final Long firstUnseen = metaData.getFirstUnseen();
+private boolean unseen(Responder responder, Long firstUnseen, final 
SelectedMailbox selected, MailboxSession session) throws MailboxException {
 if (firstUnseen != null) {
 final long unseenUid = firstUnseen;
 int msn = selected.msn(unseenUid);
 
-if (msn == SelectedMailbox.NO_SUCH_MESSAGE)
-throw new MailboxException("No message found with uid " + 
unseenUid + " in mailbox " + 
selected.getPath().getFullName(session.getPathDelimiter()));
+if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
+if (session.getLog().isDebugEnabled()) {
+session.getLog().debug("No message found with uid " + 
unseenUid + " in mailbox " + 
selected.getPath().getFullName(session.getPathDelimiter()));
+}
+return false;
+} 
 
 final StatusResponse untaggedOk = 
statusResponseFactory.untaggedOk(HumanReadableText.unseen(msn), 
ResponseCode.unseen(msn));
 responder.respond(untaggedOk);
 }
+return true;
+
 
 }
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (IMAP-345) AbstractSelectionProcessor.unseen(..) may throws MailboxException if the message was deleted by an other session

2011-10-08 Thread Norman Maurer (Created) (JIRA)
AbstractSelectionProcessor.unseen(..) may throws MailboxException if the 
message was deleted by an other session


 Key: IMAP-345
 URL: https://issues.apache.org/jira/browse/IMAP-345
 Project: JAMES Imap
  Issue Type: Bug
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


See this exception:
org.apache.james.mailbox.MailboxException: No message found with uid 505 in 
mailbox #private.INBOX.james-apache-org
  at 
org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
  at 
org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
  at 
org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
  at

We should better retry to get the first unseen in this case and only error out 
if we not was able to get it within x tries.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180444 - in /james/imap/trunk: message/src/main/java/org/apache/james/imap/decode/base/ message/src/main/java/org/apache/james/imap/decode/main/ message/src/main/java/org/apache/james/im

2011-10-08 Thread norman
Author: norman
Date: Sat Oct  8 18:14:52 2011
New Revision: 1180444

URL: http://svn.apache.org/viewvc?rev=1180444&view=rev
Log:
Call Logger.is*Enabled() before pass it to the logger. See IMAP-344

Modified:

james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java

james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java

james/imap/trunk/message/src/main/java/org/apache/james/imap/encode/base/EndImapEncoder.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AppendProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AuthenticateProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CloseProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CopyProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CreateProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/DeleteProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/EnableProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ExpungeProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LogoutProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SubscribeProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SystemMessageProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/UnsubscribeProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java

Modified: 
james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java?rev=1180444&r1=1180443&r2=1180444&view=diff
==
--- 
james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java
 (original)
+++ 
james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java
 Sat Oct  8 18:14:52 2011
@@ -85,7 +85,9 @@ public abstract class AbstractImapComman
 
 result = decode(command, request, tag, session);
 } catch (DecodingException e) {
-session.getLog().debug("Cannot parse protocol ", e);
+if (session.getLog().isDebugEnabled()) {
+session.getLog().debug("Cannot parse protocol ", e);
+}
 result = statusResponseFactory.taggedBad(tag, command, 
e.getKey());
 }
 }

Modified: 
james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java?rev=1180444&r1=1180443&r2=1180444&view=diff
==
--- 
james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java
 (original)
+++ 
james/imap/trunk/message/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java
 Sat Oct  8 18:14:52 2011
@@ -72,7 +72,9 @@ public class DefaultImapDecoder implemen
 final String tag = request.tag();
 message = decodeCommandTagged(request, tag, session);
 } catch (DecodingException e) {
-logger.debug("Cannot parse tag", e);
+if (logger.isDebugEnabled()) {
+logger.debug("Cannot parse

[jira] [Created] (IMAP-344) Call Logger.is*Enabled() before pass it to the logger

2011-10-08 Thread Norman Maurer (Created) (JIRA)
Call Logger.is*Enabled() before pass it to the logger
-

 Key: IMAP-344
 URL: https://issues.apache.org/jira/browse/IMAP-344
 Project: JAMES Imap
  Issue Type: Improvement
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


We should call Logger.is*Enabled() before pass the to be logged value to the 
logger

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: Cut Apache James Mailbox 0.4-beta1 ?

2011-10-08 Thread Norman Maurer
You are right...

Loglevel adjusted :)

https://issues.apache.org/jira/browse/IMAP-343

Bye,
Norman

2011/10/8 Eric Charles :
> yes, maildir.
>
> I already had such issue selecting a mailbox.
> Removing james-uidlist james-uidvalidity made it work.
> If I remember well, we are now skipping any invalid line in the uidlist.
>
> This time, remove these files didn't help, this is why I raised the log
> level
>
> Eric
>
> On 08/10/11 18:10, Norman Maurer wrote:
>>
>> Interesting...
>>
>> I will have a look later. what mailbox format you use ? maildir ?
>>
>> Bye,
>> Norman
>>
>>
>> 2011/10/8 Eric Charles:
>>>
>>> Hi,
>>> The spring for hbase is OK (maybe not exactly what we wanted, but still
>>> acceptable).
>>>
>>> I just tried to migrate to latest snapshot to validate protocols, but
>>> felt
>>> on an issue ("unable to select folder"). After raising log level for imap
>>> to
>>> debug:
>>>
>>> org.apache.james.mailbox.MailboxException: No message found with uid 505
>>> in
>>> mailbox #private.INBOX.james-apache-org
>>>   at
>>>
>>> org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>>>   at
>>>
>>> org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>>>   at
>>>
>>> org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
>>>   at
>>>
>>>
>>> I don't know if this is related to a local bad config/manipulation, to
>>> imap,
>>> to mailbox?
>>>
>>> I will retry a migration to latest snapshot tomorrow.
>>>
>>> Thx.
>>>
>>>
>>> On 08/10/11 16:52, Norman Maurer wrote:
>>>>
>>>> Hi there,
>>>>
>>>> anything left before we cut Apache James Mailbox 0.4-beta1 ?
>>>>
>>>> @Eric:
>>>> Anything resolved with the spring stuff ?
>>>>
>>>> Bye,
>>>> Norman
>>>>
>>>> -
>>>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>>>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>>>
>>>
>>> --
>>> Eric
>>> http://about.echarles.net
>>>
>>> -
>>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>
>
> --
> Eric
> http://about.echarles.net
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180423 - in /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor: ./ fetch/

2011-10-08 Thread norman
Author: norman
Date: Sat Oct  8 17:42:39 2011
New Revision: 1180423

URL: http://svn.apache.org/viewvc?rev=1180423&view=rev
Log:
Log "fatal" MailboxExceptions via info level. See IMAP-343

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AppendProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CloseProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CopyProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CreateProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/DeleteProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/EnableProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ExpungeProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LogoutProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SubscribeProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/UnsubscribeProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java?rev=1180423&r1=1180422&r2=1180423&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java
 Sat Oct  8 17:42:39 2011
@@ -90,7 +90,7 @@ public abstract class AbstractAuthProces
 }
 }
 } catch (MailboxException e) {
-session.getLog().debug("Login failed", e);
+session.getLog().info("Login failed", e);
 no(command, tag, responder, 
HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING);
 }
 }

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java?rev=1180423&r1=1180422&r2=1180423&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
 Sat Oct  8 17:42:39 2011
@@ -212,10 +212,10 @@ abstract public class AbstractMailboxPro
 
 final Collection flagUpdateUids = selected.flagUpdateUids();
 if (!flagUpdateUids.isEmpty()) {
-   Iterator ranges = 
MessageRange.toRanges(flagUpdateUids).iterator();
-   while(ranges.hasNext()) {
-   addFlagsResponses(session, selected, responder, useUid, 
ranges.next(), mailbox, mailboxSession);
-   }
+Iterator ranges = 
MessageRange.toRanges(flagUpdateUids).iterator();
+while(ranges.hasNext()) {
+addFlagsResponses(session, selected, responder, useUid, 
ranges.next(), mailbox, mailboxSession);
+}
 
 }
 } catch (MailboxException e) {

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSele

[jira] [Created] (IMAP-343) Log "fatal" MailboxExceptions via info level

2011-10-08 Thread Norman Maurer (Created) (JIRA)
Log "fatal" MailboxExceptions via info level


 Key: IMAP-343
 URL: https://issues.apache.org/jira/browse/IMAP-343
 Project: JAMES Imap
  Issue Type: Improvement
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


At the moment we log any MailboxException with debug level. Thats not what we 
should do. We should log "fatal" MailboxExceptions with info level and the 
expected with debug.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-343) Log "fatal" MailboxExceptions via info level

2011-10-08 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-343.


Resolution: Fixed

Done!

> Log "fatal" MailboxExceptions via info level
> 
>
> Key: IMAP-343
> URL: https://issues.apache.org/jira/browse/IMAP-343
> Project: JAMES Imap
>  Issue Type: Improvement
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> At the moment we log any MailboxException with debug level. Thats not what we 
> should do. We should log "fatal" MailboxExceptions with info level and the 
> expected with debug.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[VOTE] Release Apache James Mime4j 0.7.1

2011-10-08 Thread Norman Maurer
Hi there,

its time for first patch release of the 0.7 series. Please cast you
vote for release Apache James Mime4j 0.7.1.

A list of fixes are here:
https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.1%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESC&mode=hide

Release for review:
https://repository.apache.org/content/repositories/orgapachejames-045/

[ ] +1 Please release
[ ] +0 No time to review
[ ] -1 Something wrong which blocks the release.


Thanks,
Norman

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: svn commit: r1180096 - /james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java

2011-10-08 Thread Norman Maurer
I guess you are right synchronization should be faster then doing
a fs access here anyway.

Please commit :)

Bye,
Norman


2011/10/8 Felix Knecht :
> Wouldn't it make more sense to synchronize on queueF? There's BTW the same
> problem for deleteFile (see first part of diff).
>
> Regards
> Felix
>
> Index:
> src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
> ===
> ---
> src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
> (revision 1180096)
> +++
> src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
> (working copy)
> @@ -104,8 +104,8 @@
>      */
>     public void deleteFile(ActiveMQBlobMessage message) throws IOException,
> JMSException {
>         File f = getFile(message);
> -        if (f.exists()) {
> -            if (f.delete() == false) {
> +        synchronized (f) {
> +            if (f.exists() && !f.delete()) {
>                 throw new IOException("Unable to delete file " + f);
>             }
>         }
> @@ -143,20 +143,12 @@
>
>         File queueF = fs.getFile(queueUrl);
>
> -        // check if we need to create the queue folder
> -        if (!queueF.exists()) {
> -            if (!queueF.mkdirs()) {
> -                // It could be that queueF.mkdirs() returned false because
> -                // queueF has been created
> -                // in the meantime (eg. by a different thread). Only throw
> an
> -                // exception if this is
> -                // not the case.
> -                if (!queueF.exists()) {
> -                    throw new IOException("Unable to create directory " +
> queueF.getAbsolutePath());
> -                }
> +        synchronized (queueF) {
> +            // check if we need to create the queue folder
> +            if (!queueF.exists() && !queueF.mkdirs()) {
> +                throw new IOException("Unable to create directory " +
> queueF.getAbsolutePath());
>             }
> -
> -         }
> +        }
>
>         return fs.getFile(queueUrl + "/" + filename);
>
>
> On 10/07/2011 06:42 PM, nor...@apache.org wrote:
>>
>> Author: norman
>> Date: Fri Oct  7 16:42:36 2011
>> New Revision: 1180096
>>
>> URL: http://svn.apache.org/viewvc?rev=1180096&view=rev
>> Log:
>> Make getFile(...) method of FileSystemBlobStrategy thread-safe. Thanks to
>> Michael Herrmann for the patch. See JAMES-1327
>>
>> Modified:
>>
>> james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
>>
>> Modified:
>> james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
>> URL:
>> http://svn.apache.org/viewvc/james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java?rev=1180096&r1=1180095&r2=1180096&view=diff
>>
>> ==
>> ---
>> james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
>> (original)
>> +++
>> james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
>> Fri Oct  7 16:42:36 2011
>> @@ -144,11 +144,20 @@ public class FileSystemBlobStrategy impl
>>          File queueF = fs.getFile(queueUrl);
>>
>>          // check if we need to create the queue folder
>> -        if (queueF.exists() == false) {
>> +        if (!queueF.exists()) {
>>              if (!queueF.mkdirs()) {
>> -                throw new IOException("Unable to create directory " +
>> queueF.getAbsolutePath());
>> +                // It could be that queueF.mkdirs() returned false
>> because
>> +                // queueF has been created
>> +                // in the meantime (eg. by a different thread). Only
>> throw an
>> +                // exception if this is
>> +                // not the case.
>> +                if (!queueF.exists()) {
>> +                    throw new IOException("Unable to create directory " +
>> queueF.getAbsolutePath());
>> +                }
>>              }
>> -        }
>> +
>> +         }
>> +
>>          return fs.getFile(queueUrl + "/" + filename);
>>
>>      }
>>
>>
>>
>> -
>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: Mailbox doc

2011-10-08 Thread Norman Maurer
hmm

not sure why it show not up on the ml.

Bye,
Norman

2011/10/8 Eric Charles :
> Hi,
>
> I just built mailbox web site further to Ioan's today commits.
> Good job Ioan! We could deploy it as such even if some titles still needs to
> be completed.
>
> btw, I didn't see the commit log sent by mail
> (http://markmail.org/search/?q=list%3Ajames+order%3Adate-backward+ioan
> doesn't show the today commits).
>
> Thx,
>
> Eric
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Re: Cut Apache James Mailbox 0.4-beta1 ?

2011-10-08 Thread Norman Maurer
Interesting...

I will have a look later. what mailbox format you use ? maildir ?

Bye,
Norman


2011/10/8 Eric Charles :
> Hi,
> The spring for hbase is OK (maybe not exactly what we wanted, but still
> acceptable).
>
> I just tried to migrate to latest snapshot to validate protocols, but felt
> on an issue ("unable to select folder"). After raising log level for imap to
> debug:
>
> org.apache.james.mailbox.MailboxException: No message found with uid 505 in
> mailbox #private.INBOX.james-apache-org
>   at
> org.apache.james.imap.processor.AbstractSelectionProcessor.unseen(AbstractSelectionProcessor.java:357)
>   at
> org.apache.james.imap.processor.AbstractSelectionProcessor.respond(AbstractSelectionProcessor.java:134)
>   at
> org.apache.james.imap.processor.AbstractSelectionProcessor.doProcess(AbstractSelectionProcessor.java:92)
>   at
>
>
> I don't know if this is related to a local bad config/manipulation, to imap,
> to mailbox?
>
> I will retry a migration to latest snapshot tomorrow.
>
> Thx.
>
>
> On 08/10/11 16:52, Norman Maurer wrote:
>>
>> Hi there,
>>
>> anything left before we cut Apache James Mailbox 0.4-beta1 ?
>>
>> @Eric:
>> Anything resolved with the spring stuff ?
>>
>> Bye,
>> Norman
>>
>> -
>> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-dev-h...@james.apache.org
>>
>
> --
> Eric
> http://about.echarles.net
>
> -
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Cut Apache James Mailbox 0.4-beta1 ?

2011-10-08 Thread Norman Maurer
Hi there,

anything left before we cut Apache James Mailbox 0.4-beta1 ?

@Eric:
Anything resolved with the spring stuff ?

Bye,
Norman

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180366 - /james/mailbox-integration-tester/trunk/pom.xml

2011-10-08 Thread norman
Author: norman
Date: Sat Oct  8 12:19:49 2011
New Revision: 1180366

URL: http://svn.apache.org/viewvc?rev=1180366&view=rev
Log:
fix hbase/hadoop versions

Modified:
james/mailbox-integration-tester/trunk/pom.xml

Modified: james/mailbox-integration-tester/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox-integration-tester/trunk/pom.xml?rev=1180366&r1=1180365&r2=1180366&view=diff
==
--- james/mailbox-integration-tester/trunk/pom.xml (original)
+++ james/mailbox-integration-tester/trunk/pom.xml Sat Oct  8 12:19:49 2011
@@ -29,8 +29,8 @@
 Apache James Mailbox Integration Tester
 
 
-0.90.3
-0.20-append-r1057313
+0.90.4
+0.20.204.0
 2.0.1
 4.8.2
 1.2.16
@@ -42,19 +42,7 @@
 1.4.1
 1.6
 
-
-
-hadoop-non-releases
-Hadoop non-releases
-http://people.apache.org/~rawson/repo/
-
-false
-
-
-true
-
-
-
+  
 
 
 
@@ -216,7 +204,7 @@
 
 org.apache.hadoop
 hadoop-test
-0.20-append-r1057313
+${hadoop.version}
 test
 
 



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Commented] (HUPA-80) Use slf4j as log facade

2011-10-07 Thread Norman Maurer (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/HUPA-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13123394#comment-13123394
 ] 

Norman Maurer commented on HUPA-80:
---

Huh...

I never saw such problems here. Can you please open a issue in JAMES project 
and attach more details ? 

> Use slf4j as log facade
> ---
>
> Key: HUPA-80
> URL: https://issues.apache.org/jira/browse/HUPA-80
> Project: JAMES Hupa
>  Issue Type: Task
>Affects Versions: 0.1
>Reporter: Felix Knecht
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-342) SELECT a mailbox can "miss" events

2011-10-07 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-342.


Resolution: Fixed

done

> SELECT a mailbox can "miss" events
> --
>
> Key: IMAP-342
> URL: https://issues.apache.org/jira/browse/IMAP-342
> Project: JAMES Imap
>  Issue Type: Bug
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> When SELECT a mailbox we first retrieve all needed data from the mailbox and 
> then add the listeners which are responsible to handle updates on the 
> mailbox. The problem is that that we may miss some event as the add of the 
> listeners may take some time. The correct way would be to add the listeners 
> first and then handle the rest (ignore events for duplicate uids then).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180251 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 21:30:46 2011
New Revision: 1180251

URL: http://svn.apache.org/viewvc?rev=1180251&view=rev
Log:
Add tests back. See IMAP-342

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1180251&r1=1180250&r2=1180251&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Fri Oct  7 21:30:46 2011
@@ -44,13 +44,6 @@ import org.apache.james.mailbox.MessageR
 import org.apache.james.mailbox.MessageResult;
 import org.apache.james.mailbox.MessageResultIterator;
 import org.apache.james.mailbox.UpdatedFlags;
-import org.apache.james.mailbox.MailboxListener.Added;
-import org.apache.james.mailbox.MailboxListener.Event;
-import org.apache.james.mailbox.MailboxListener.Expunged;
-import org.apache.james.mailbox.MailboxListener.FlagsUpdated;
-import org.apache.james.mailbox.MailboxListener.MailboxDeletion;
-import org.apache.james.mailbox.MailboxListener.MailboxRenamed;
-import org.apache.james.mailbox.MailboxListener.MessageEvent;
 
 /**
  * Default implementation of {@link SelectedMailbox}
@@ -497,11 +490,14 @@ public class SelectedMailboxImpl impleme
 FlagsUpdated updated = (FlagsUpdated) messageEvent;
 List uFlags = updated.getUpdatedFlags();
 if (sessionId != eventSessionId || !silentFlagChanges) {
+
 for (int i = 0; i < uFlags.size(); i++) {
 UpdatedFlags u = uFlags.get(i);
+
 if (interestingFlags(u)) {
+
 flagUpdateUids.add(u.getUid());
-
+
 }
 }
 }



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180250 - /james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 21:29:08 2011
New Revision: 1180250

URL: http://svn.apache.org/viewvc?rev=1180250&view=rev
Log:
Add tests back. See IMAP-342

Modified:

james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java

Modified: 
james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java?rev=1180250&r1=1180249&r2=1180250&view=diff
==
--- 
james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
 (original)
+++ 
james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
 Fri Oct  7 21:29:08 2011
@@ -24,9 +24,13 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Date;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import javax.mail.Flags;
@@ -36,9 +40,23 @@ import org.apache.james.imap.api.ImapSes
 import org.apache.james.imap.api.process.ImapLineHandler;
 import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.api.process.SelectedMailbox;
+import org.apache.james.mailbox.BadCredentialsException;
+import org.apache.james.mailbox.Content;
+import org.apache.james.mailbox.Headers;
+import org.apache.james.mailbox.MailboxException;
 import org.apache.james.mailbox.MailboxListener;
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxMetaData;
 import org.apache.james.mailbox.MailboxPath;
+import org.apache.james.mailbox.MailboxQuery;
 import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageManager;
+import org.apache.james.mailbox.MessageRange;
+import org.apache.james.mailbox.MessageResult;
+import org.apache.james.mailbox.MessageResult.FetchGroup;
+import org.apache.james.mailbox.MessageResultIterator;
+import org.apache.james.mailbox.MimeDescriptor;
+import org.apache.james.mailbox.SearchQuery;
 import org.apache.james.mailbox.UpdatedFlags;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -49,7 +67,265 @@ public class MailboxEventAnalyserTest {
 
 
 private MailboxPath mailboxPath = new MailboxPath("namespace", "user", 
"name");
-
+private final MailboxManager mockManager = new MailboxManager() {
+
+@Override
+public void removeListener(MailboxPath mailboxPath, MailboxListener 
listner, MailboxSession session) throws MailboxException {
+
+}
+
+@Override
+public void removeGlobalListener(MailboxListener listner, 
MailboxSession session) throws MailboxException {
+
+}
+
+@Override
+public void addListener(MailboxPath mailboxPath, MailboxListener 
listener, MailboxSession session) throws MailboxException {
+
+}
+
+@Override
+public void addGlobalListener(MailboxListener listener, MailboxSession 
session) throws MailboxException {
+
+}
+
+@Override
+public void startProcessingRequest(MailboxSession session) {
+
+}
+
+@Override
+public void endProcessingRequest(MailboxSession session) {
+
+}
+
+@Override
+public List search(MailboxQuery expression, 
MailboxSession session) throws MailboxException {
+throw new UnsupportedOperationException("Not implemented");
+
+}
+
+@Override
+public void renameMailbox(MailboxPath from, MailboxPath to, 
MailboxSession session) throws MailboxException {
+throw new UnsupportedOperationException("Not implemented");
+
+}
+
+@Override
+public boolean mailboxExists(MailboxPath mailboxPath, MailboxSession 
session) throws MailboxException {
+throw new UnsupportedOperationException("Not implemented");
+
+}
+
+@Override
+public void logout(MailboxSession session, boolean force) throws 
MailboxException {
+throw new UnsupportedOperationException("Not implemented");
+
+}
+
+@Override
+public MailboxSession login(String userid, String passwd, Logger log) 
throws BadCredentialsException, MailboxException {
+throw new UnsupportedOperationException("Not implemented");
+
+}
+
+@Override
+  

svn commit: r1180227 - in /james/imap/trunk/processor/src: main/java/org/apache/james/imap/processor/base/ test/java/org/apache/james/imap/processor/base/

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 20:50:38 2011
New Revision: 1180227

URL: http://svn.apache.org/viewvc?rev=1180227&view=rev
Log:
Make sure event can not get missed on select. See IMAP-342

Removed:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/MailboxEventAnalyser.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/UidToMsnConverter.java
Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1180227&r1=1180226&r2=1180227&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Fri Oct  7 20:50:38 2011
@@ -21,32 +21,41 @@ package org.apache.james.imap.processor.
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
 import java.util.TreeSet;
 
 import javax.mail.Flags;
+import javax.mail.Flags.Flag;
 
 import org.apache.james.imap.api.ImapSessionUtils;
 import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.api.process.SelectedMailbox;
 import org.apache.james.mailbox.MailboxException;
+import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxPath;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageRange;
 import org.apache.james.mailbox.MessageResult;
 import org.apache.james.mailbox.MessageResultIterator;
+import org.apache.james.mailbox.UpdatedFlags;
+import org.apache.james.mailbox.MailboxListener.Added;
+import org.apache.james.mailbox.MailboxListener.Event;
+import org.apache.james.mailbox.MailboxListener.Expunged;
+import org.apache.james.mailbox.MailboxListener.FlagsUpdated;
+import org.apache.james.mailbox.MailboxListener.MailboxDeletion;
+import org.apache.james.mailbox.MailboxListener.MailboxRenamed;
+import org.apache.james.mailbox.MailboxListener.MessageEvent;
 
 /**
  * Default implementation of {@link SelectedMailbox}
  */
-public class SelectedMailboxImpl implements SelectedMailbox {
-
-private final MailboxEventAnalyser events;
-
-private final UidToMsnConverter converter;
+public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
 
 private final Set recentUids;
 
@@ -68,12 +77,56 @@ public class SelectedMailboxImpl impleme
 FLAGS.add(Flags.Flag.SEEN);
 }
 
+private final long sessionId;
+private Set flagUpdateUids;
+private Flags.Flag uninterestingFlag;
+private Set expungedUids;
+
+private boolean isDeletedByOtherSession = false;
+private boolean sizeChanged = false;
+private boolean silentFlagChanges = false;
+private Flags applicableFlags;
+private boolean applicableFlagsChanged;
+
+private SortedMap msnToUid;
+
+private SortedMap uidToMsn;
+
+private long highestUid = 0;
+
+private int highestMsn = 0;
 
 public SelectedMailboxImpl(final MailboxManager mailboxManager, final 
ImapSession session, final MailboxPath path) throws MailboxException {
 recentUids = new TreeSet();
 recentUidRemoved = false;
+this.session = session;
+this.sessionId = 
ImapSessionUtils.getMailboxSession(session).getSessionId();
+flagUpdateUids = new TreeSet();
+expungedUids = new TreeSet();
+uninterestingFlag = Flags.Flag.RECENT;
+this.mailboxManager = mailboxManager;
+
+// Ignore events from our session
+setSilentFlagChanges(true);
+this.path = path;
+this.session = session;
+
+init();
+}
+ 
 
+private synchronized void init() throws MailboxException {
 MailboxSession mailboxSession = 
ImapSessionUtils.getMailboxSession(session);
+
+mailboxManager.addListener(path, this, mailboxSession);
+
+
+int msn = 1;
+msnToUid = new TreeMap();
+uidToMsn = new TreeMap();
+
+
+ 
 MessageResultIterator messages = mailboxManager.getMailbox(path, 
mailboxSession).getMessages(MessageRange.all(), FetchGroupImpl.MINIMAL, 
mailboxSession);
 Flags applicableFlags = new Flags(FLAGS);
 List uids = new ArrayList();
@@ -81,90 +1

svn commit: r1180198 - in /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor: AbstractSelectionProcessor.java base/SelectedMailboxImpl.java

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 20:17:01 2011
New Revision: 1180198

URL: http://svn.apache.org/viewvc?rev=1180198&view=rev
Log:
Start on work to make sure event can not get missed on select. See IMAP-342

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java?rev=1180198&r1=1180197&r2=1180198&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
 Fri Oct  7 20:17:01 2011
@@ -61,8 +61,6 @@ import org.apache.james.mailbox.MessageR
 
 abstract class AbstractSelectionProcessor extends AbstractMailboxProcessor implements 
PermitEnableCapabilityProcessor {
 
-private final Flags flags = new Flags();
-
 final StatusResponseFactory statusResponseFactory;
 
 private final boolean openReadOnly;
@@ -73,11 +71,7 @@ abstract class AbstractSelectionProcesso
 super(acceptableClass, next, mailboxManager, statusResponseFactory);
 this.statusResponseFactory = statusResponseFactory;
 this.openReadOnly = openReadOnly;
-flags.add(Flags.Flag.ANSWERED);
-flags.add(Flags.Flag.DELETED);
-flags.add(Flags.Flag.DRAFT);
-flags.add(Flags.Flag.FLAGGED);
-flags.add(Flags.Flag.SEEN);
+
 }
 
 /*
@@ -403,7 +397,9 @@ abstract class AbstractSelectionProcesso
 if (currentMailbox != null) {
 
getStatusResponseFactory().untaggedOk(HumanReadableText.QRESYNC_CLOSED, 
ResponseCode.closed());
 }
-sessionMailbox = createNewSelectedMailbox(mailbox, mailboxSession, 
session, mailboxPath);
+session.selected(new SelectedMailboxImpl(getMailboxManager(),  
session, mailboxPath));
+
+sessionMailbox = session.getSelected();
 
 } else {
 // TODO: Check if we need to handle CONDSTORE there too 
@@ -414,25 +410,6 @@ abstract class AbstractSelectionProcesso
 return metaData;
 }
 
-private SelectedMailbox createNewSelectedMailbox(final MessageManager 
mailbox, final MailboxSession mailboxSession, ImapSession session, MailboxPath 
path) throws MailboxException {
-
-MessageResultIterator messages = 
mailbox.getMessages(MessageRange.all(), FetchGroupImpl.MINIMAL, mailboxSession);
-Flags applicableFlags = new Flags(flags);
-List uids = new ArrayList();
-while(messages.hasNext()) {
-MessageResult mr = messages.next();
-applicableFlags.add(mr.getFlags());
-uids.add(mr.getUid());
-}
-
-
-// \RECENT is not a applicable flag in imap so remove it from the list
-applicableFlags.remove(Flags.Flag.RECENT);
-
-final SelectedMailbox sessionMailbox = new 
SelectedMailboxImpl(getMailboxManager(), uids.iterator(),applicableFlags,  
session, path);
-session.selected(sessionMailbox);
-return sessionMailbox;
-}
 
 private void addRecent(final MessageManager.MetaData metaData, 
SelectedMailbox sessionMailbox) throws MailboxException {
 final List recentUids = metaData.getRecent();

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java?rev=1180198&r1=1180197&r2=1180198&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
 Fri Oct  7 20:17:01 2011
@@ -22,6 +22,7 @@ package org.apache.james.imap.processor.
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -34,6 +35,9 @@ import org.apache.james.mailbox.MailboxE
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxPath;
 import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageRange;
+import org.apache.james.mailbox.MessageResult;
+import org.apache.james.mailbox.MessageResultIterator;
 
 /**
  * Default implementation of {@lin

[jira] [Created] (IMAP-342) SELECT a mailbox can "miss" events

2011-10-07 Thread Norman Maurer (Created) (JIRA)
SELECT a mailbox can "miss" events
--

 Key: IMAP-342
 URL: https://issues.apache.org/jira/browse/IMAP-342
 Project: JAMES Imap
  Issue Type: Bug
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


When SELECT a mailbox we first retrieve all needed data from the mailbox and 
then add the listeners which are responsible to handle updates on the mailbox. 
The problem is that that we may miss some event as the add of the listeners may 
take some time. The correct way would be to add the listeners first and then 
handle the rest (ignore events for duplicate uids then).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1327) FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe (throws "java.io.IOException: Unable to create directory")

2011-10-07 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1327.
--

   Resolution: Fixed
Fix Version/s: 3.0-beta4
 Assignee: Norman Maurer

Patch applied. Thanks again...

> FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe 
> (throws "java.io.IOException: Unable to create directory")
> -
>
> Key: JAMES-1327
> URL: https://issues.apache.org/jira/browse/JAMES-1327
> Project: JAMES Server
>  Issue Type: Bug
>  Components: Queue
>Affects Versions: 3.0-beta3
> Environment: At least Windows and Linux. 
>Reporter: Michael Herrmann
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
> Attachments: JAMES-1327.patch
>
>
> Consider 
> org.apache.james.queue.activemq.FileSystemBlobStrategy#getFile(ActiveMQBlobMessage):
> protected File getFile(ActiveMQBlobMessage message) throws JMSException, 
> IOException {
> ...
> // check if we need to create the queue folder
> if (queueF.exists() == false) {
> if (!queueF.mkdirs()) {
> throw new IOException("Unable to create directory " + 
> queueF.getAbsolutePath());
> }
> }
> ...
> }
> Suppose this method is called from two threads. If both threads get past the 
> condition
> if (queueF.exists() == false),
> then the first one will create queueF. For the second, queueF.mkdirs() will 
> then return false, which leads to an IOException even though everything is 
> fine. I think the condition should be replaced by
> if (!queueF.mkdirs() && !queueF.exists()).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180096 - /james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 16:42:36 2011
New Revision: 1180096

URL: http://svn.apache.org/viewvc?rev=1180096&view=rev
Log:
Make getFile(...) method of FileSystemBlobStrategy thread-safe. Thanks to 
Michael Herrmann for the patch. See JAMES-1327

Modified:

james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java

Modified: 
james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java?rev=1180096&r1=1180095&r2=1180096&view=diff
==
--- 
james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
 (original)
+++ 
james/server/trunk/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
 Fri Oct  7 16:42:36 2011
@@ -144,11 +144,20 @@ public class FileSystemBlobStrategy impl
 File queueF = fs.getFile(queueUrl);
 
 // check if we need to create the queue folder
-if (queueF.exists() == false) {
+if (!queueF.exists()) {
 if (!queueF.mkdirs()) {
-throw new IOException("Unable to create directory " + 
queueF.getAbsolutePath());
+// It could be that queueF.mkdirs() returned false because
+// queueF has been created
+// in the meantime (eg. by a different thread). Only throw an
+// exception if this is
+// not the case.
+if (!queueF.exists()) {
+throw new IOException("Unable to create directory " + 
queueF.getAbsolutePath());
+}
 }
-}
+ 
+ }
+
 return fs.getFile(queueUrl + "/" + filename);
 
 }



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (IMAP-341) IdleProcessor sends message to client before add IdleStateListener

2011-10-07 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAP-341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved IMAP-341.


Resolution: Fixed

done

> IdleProcessor sends message to client before add IdleStateListener
> --
>
> Key: IMAP-341
> URL: https://issues.apache.org/jira/browse/IMAP-341
> Project: JAMES Imap
>  Issue Type: Bug
>  Components: Processor
>Affects Versions: 0.2.1
>Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 0.3
>
>
> The IdleProcessor does send the "+\r\n" message back to the client and then 
> add the IdleStateListener to the Mailbox. This can lead to some kind of 
> race-condition as the Client may miss an event this way. The correct way 
> would be to fist add the Listener and then write the message

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180095 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 16:36:25 2011
New Revision: 1180095

URL: http://svn.apache.org/viewvc?rev=1180095&view=rev
Log:
First add the IdleStateListener and then write the response back the client. 
See IMAP-341

Modified:

james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java

Modified: 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java?rev=1180095&r1=1180094&r2=1180095&view=diff
==
--- 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
 (original)
+++ 
james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/IdleProcessor.java
 Fri Oct  7 16:36:25 2011
@@ -74,9 +74,7 @@ public class IdleProcessor extends Abstr
 protected void doProcess(final IdleRequest message, final ImapSession 
session, final String tag, final ImapCommand command, final Responder 
responder) {
 
 try {
-responder.respond(new 
ContinuationResponse(HumanReadableText.IDLING));
-unsolicitedResponses(session, responder, false);
-
+  
 final MailboxManager mailboxManager = getMailboxManager();
 final MailboxSession mailboxSession = 
ImapSessionUtils.getMailboxSession(session);
 final SelectedMailbox sm = session.getSelected();
@@ -148,6 +146,12 @@ public class IdleProcessor extends Abstr
 }
 }, heartbeatInterval, heartbeatIntervalUnit);
 }
+
+// Write the response after the listener was add
+// IMAP-341
+responder.respond(new 
ContinuationResponse(HumanReadableText.IDLING));
+unsolicitedResponses(session, responder, false);
+
 
 } catch (MailboxException e) {
 session.getLog().debug("Idle failed", e);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (IMAP-341) IdleProcessor sends message to client before add IdleStateListener

2011-10-07 Thread Norman Maurer (Created) (JIRA)
IdleProcessor sends message to client before add IdleStateListener
--

 Key: IMAP-341
 URL: https://issues.apache.org/jira/browse/IMAP-341
 Project: JAMES Imap
  Issue Type: Bug
  Components: Processor
Affects Versions: 0.2.1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.3


The IdleProcessor does send the "+\r\n" message back to the client and then add 
the IdleStateListener to the Mailbox. This can lead to some kind of 
race-condition as the Client may miss an event this way. The correct way would 
be to fist add the Listener and then write the message

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (JAMES-1214) Make it easier to configure more instances of IMAPServer/SMTPServer/LMTPServer/POP3Server

2011-10-07 Thread Norman Maurer (Resolved) (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Norman Maurer resolved JAMES-1214.
--

   Resolution: Fixed
Fix Version/s: 3.0-beta4

done!

> Make it easier to configure more instances of 
> IMAPServer/SMTPServer/LMTPServer/POP3Server
> -
>
> Key: JAMES-1214
> URL: https://issues.apache.org/jira/browse/JAMES-1214
> Project: JAMES Server
>  Issue Type: New Feature
>    Reporter: Norman Maurer
>Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
>
> At the moment to configure for example two instances of SMTPServer which 
> listen on different ports you need to clone the config file and need to hack 
> the spring configuration files. This should be easier

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1180046 - in /james/app/trunk/src/main/app/bin: setenv.bat setenv.sh

2011-10-07 Thread norman
Author: norman
Date: Fri Oct  7 14:05:20 2011
New Revision: 1180046

URL: http://svn.apache.org/viewvc?rev=1180046&view=rev
Log:
Use wildcard classpath to load custom mailets in conf/lib/ directory. See 
JAMESAPP-2

Modified:
james/app/trunk/src/main/app/bin/setenv.bat
james/app/trunk/src/main/app/bin/setenv.sh

Modified: james/app/trunk/src/main/app/bin/setenv.bat
URL: 
http://svn.apache.org/viewvc/james/app/trunk/src/main/app/bin/setenv.bat?rev=1180046&r1=1180045&r2=1180046&view=diff
==
--- james/app/trunk/src/main/app/bin/setenv.bat (original)
+++ james/app/trunk/src/main/app/bin/setenv.bat Fri Oct  7 14:05:20 2011
@@ -16,4 +16,4 @@
 @REM
 
 @REM Add every needed extra jar to this 
-set CLASSPATH_PREFIX=
\ No newline at end of file
+set CLASSPATH_PREFIX=../conf/lib/*
\ No newline at end of file

Modified: james/app/trunk/src/main/app/bin/setenv.sh
URL: 
http://svn.apache.org/viewvc/james/app/trunk/src/main/app/bin/setenv.sh?rev=1180046&r1=1180045&r2=1180046&view=diff
==
--- james/app/trunk/src/main/app/bin/setenv.sh (original)
+++ james/app/trunk/src/main/app/bin/setenv.sh Fri Oct  7 14:05:20 2011
@@ -16,5 +16,5 @@
 # 
 #
 # Add every needed extra jar to this
-CLASSPATH_PREFIX=
+CLASSPATH_PREFIX=../conf/lib/*
 export CLASSPATH_PREFIX
\ No newline at end of file



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



<    2   3   4   5   6   7   8   9   10   11   >