svn commit: r1231561 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-14 Thread norman
Author: norman
Date: Sat Jan 14 19:00:16 2012
New Revision: 1231561

URL: http://svn.apache.org/viewvc?rev=1231561view=rev
Log:
[maven-release-plugin] prepare for next development iteration

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1231561r1=1231560r2=1231561view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Sat Jan 14 19:00:16 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1231561r1=1231560r2=1231561view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Sat Jan 14 19:00:16 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1231561r1=1231560r2=1231561view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Sat Jan 14 19:00:16 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1231561r1=1231560r2=1231561view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Sat Jan 14 19:00:16 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 packagingpom/packaging
 
 nameApache James Protocols/name
@@ -45,9 +45,9 @@
 /modules
 
 scm
-
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/connection
-
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/developerConnection
-
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk/tags/protocols-1.6.0?root=Apache-SVN/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk/connection
+
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk/developerConnection
+
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN/url
 /scm
 
 distributionManagement

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1231561r1=1231560r2=1231561view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Sat Jan 14 19:00:16 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1231561r1=1231560r2=1231561view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Sat Jan 14 19:00:16 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 



-
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 Protocols 1.6.0 (second take)

2012-01-14 Thread Norman Maurer
Hi there,

after fixing all the bugs its time to re-roll the release of Apache James
Protocols 1.6.0.

Artifacts to review:
https://repository.apache.org/content/repositories/orgapachejames-065/

Changes:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311060version=12319289

Please cast your VOTE:

[ ] +1 Yes, please release
[ ] +0 No time to review
[ ] -1 Something is wrong...


Re: ACL Support - cont. from server-user

2012-01-13 Thread Norman Maurer
It will get added back soon ;) But as Eric already said better use
imap/trunk for now.

Bye,
Norman

2012/1/13 Jochen Gazda gazdahims...@gmail.com

 Thank you for your advice, Eric, but my efforts with protocols-imap
 are pointless now, as protocols-imap was removed from the svn repo
 yesterday.

 Gazda

 On Wed, Jan 11, 2012 at 8:38 PM, Eric Charles e...@apache.org wrote:
  Hi Jochen,
 
  You will need to replace all references in sever and app pom to
  apache-james-server-imap-* with
 
 groupIdorg.apache.james.protocols/groupId
 artifactIdprotocols-imap/artifactId
 
 
  As said earlier, this copy of imap is less stable.
 
  Thx,
 
  Eric
 
 
 
  On 10/01/12 19:52, Jochen Gazda wrote:
 
  Eric,
 
  On Fri, Jan 6, 2012 at 6:34 PM, Eric Charlese...@apache.org  wrote:
 
  As a side note, we are moving IMAP code from
 
  https://svn.apache.org/repos/asf/james/imap/trunk/
  to
  https://svn.apache.org/repos/asf/james/protocols/trunk/imap/
 
  I would be better that you code in the latter.
 
 
  I have coded with /james/protocols/trunk/imap/ and I would like run my
  code with James. How can I do it?
  The default build results in James with /james/imap/trunk/. How can I
  replace it?
 
  Thanks,
 
  Gazda
 
  -
  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 | @echarles
 
  -
  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: r1231143 - in /james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core: AbstractAddHeadersFilter.java ReceivedDataLineFilter.java esmtp/EhloCmdHandler.java fastfail/R

2012-01-13 Thread norman
Author: norman
Date: Fri Jan 13 16:02:44 2012
New Revision: 1231143

URL: http://svn.apache.org/viewvc?rev=1231143view=rev
Log:
Correctly format the Received header and it to the message. See PROTOCOLS-88

Modified:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ResolvableEhloHeloHandler.java

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java?rev=1231143r1=1231142r2=1231143view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 Fri Jan 13 16:02:44 2012
@@ -20,7 +20,9 @@ package org.apache.james.protocols.smtp.
 
 import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.james.protocols.api.ProtocolSession.State;
@@ -99,22 +101,24 @@ public abstract class AbstractAddHeaders
 public static final String MULTI_LINE_PREFIX =   ;
 
 public final String name;
-public final String value;
-
-private final String[] lines;
-private final String lineDelimiter;
-
-public Header(String name, String value, String lineDelimiter) {
+public final ListString values = new ArrayListString();
+
+public Header(String name, String value) {
 this.name = name;
-this.value = value;
-this.lines = toString().split(lineDelimiter);
-this.lineDelimiter = lineDelimiter;
+this.values.add(value);
 }
 
-public String toString() {
- return name + :  + value + lineDelimiter;
+/**
+ * Add the value to the header
+ * @param value
+ * @return
+ */
+public Header add(String value) {
+values.add(value);
+return this;
 }
 
+
 /**
  * Transfer the content of the {@link Header} to the given {@link 
LineHandler}.
  * 
@@ -130,11 +134,17 @@ public abstract class AbstractAddHeaders
 
 try {
 Response response = null;
-for (int i = 0; i  lines.length; i++) {
- response = handler.onLine(session, 
ByteBuffer.wrap((lines[i] + session.getLineDelimiter()).getBytes(charset)));
- if (response != null) {
- break;
- }
+for (int i = 0; i  values.size(); i++) {
+String line;
+if (i == 0) {
+line = name + :  + values.get(i);
+} else {
+line = MULTI_LINE_PREFIX + values.get(i);
+}
+response = handler.onLine(session, ByteBuffer.wrap((line + 
session.getLineDelimiter()).getBytes(charset)));
+if (response != null) {
+break;
+}
 }
 return response;
 } catch (UnsupportedEncodingException e) {

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java?rev=1231143r1=1231142r2=1231143view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
 Fri Jan 13 16:02:44 2012
@@ -105,26 +105,33 @@ public class ReceivedDataLineFilter exte
 headerLineBuffer.append(from 
).append(session.getRemoteAddress().getHostName());
 
 if (heloName != null) {
-headerLineBuffer.append( ().append(heloMode).append( 
).append(heloName).append() );
+headerLineBuffer.append( ().append(heloMode).append( 
).append(heloName).append());
 }
-headerLineBuffer.append

[jira] [Resolved] (PROTOCOLS-88) Malformed Headers created by SMTP

2012-01-13 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-88.


   Resolution: Fixed
Fix Version/s: 1.6.0

fixed thanks for reporting

 Malformed Headers created by SMTP
 -

 Key: PROTOCOLS-88
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-88
 Project: JAMES Protocols
  Issue Type: Bug
  Components: smtp
Reporter: Eric Charles
Assignee: Norman Maurer
 Fix For: 1.6.0


 Sending emails with server trunk stores mails with weird headers (see [1] 
 multiples spaces, presence of 'null' string)
 Running SMTPServerTest.testSimpleDelivery shows an envelope with the 
 bytearrayoutputstream having the same issue (see [2])
 (This weird headers sometimes confuse mail client, sometimes not)
 [1]
 Return-Path: e...@localhost.net
 Delivered-To: e...@localhost.net
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 Message-ID: 4f0fd537.7030...@localhost.net
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 Date: Fri, 13 Jan 2012 07:54:47 +0100
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 From: Eric Charles Localhost e...@localhost.net
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) 
 Gecko/2005 Thunderbird/8.0
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 MIME-Version: 1.0
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 To: e...@localhost.net
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 Subject: This is a simple test subject
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Received:   by Eric-Charles-MacBook-Pro.local (null) with ESMTP ID 
 1242552473
   for e...@localhost.net;  Fri, 13 Jan 2012 07:54:48 +0100 
 (CET)null
 Content-Transfer-Encoding: 7bit
 This is a simple test body.
 Eric
 [2]
 Received:   by localhost (JAMES SMTP Protocols Server) with SMTP ID 
 127861719;  Fri, 13 Jan 2012 08:02:09 +0100 (CET)null
 Subject: Testmessage
 This is a 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: r1231145 - /james/protocols/tags/protocols-1.6.0/

2012-01-13 Thread norman
Author: norman
Date: Fri Jan 13 16:04:38 2012
New Revision: 1231145

URL: http://svn.apache.org/viewvc?rev=1231145view=rev
Log:
Remove to re-roll 

Removed:
james/protocols/tags/protocols-1.6.0/


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



svn commit: r1231154 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-13 Thread norman
Author: norman
Date: Fri Jan 13 16:16:15 2012
New Revision: 1231154

URL: http://svn.apache.org/viewvc?rev=1231154view=rev
Log:
[maven-release-plugin] prepare release protocols-1.6.0

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1231154r1=1231153r2=1231154view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Fri Jan 13 16:16:15 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1231154r1=1231153r2=1231154view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Fri Jan 13 16:16:15 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1231154r1=1231153r2=1231154view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Fri Jan 13 16:16:15 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1231154r1=1231153r2=1231154view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Fri Jan 13 16:16:15 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.1-SNAPSHOT/version
+version1.6.0/version
 packagingpom/packaging
 
 nameApache James Protocols/name
@@ -45,9 +45,9 @@
 /modules
 
 scm
-
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk/connection
-
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk/developerConnection
-
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/connection
+
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/developerConnection
+
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk/tags/protocols-1.6.0?root=Apache-SVN/url
 /scm
 
 distributionManagement

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1231154r1=1231153r2=1231154view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Fri Jan 13 16:16:15 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1231154r1=1231153r2=1231154view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Fri Jan 13 16:16:15 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 



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



svn commit: r1231155 - /james/protocols/tags/protocols-1.6.0/

2012-01-13 Thread norman
Author: norman
Date: Fri Jan 13 16:16:24 2012
New Revision: 1231155

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

Added:
james/protocols/tags/protocols-1.6.0/
  - copied from r1231154, 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: r1231156 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-13 Thread norman
Author: norman
Date: Fri Jan 13 16:16:29 2012
New Revision: 1231156

URL: http://svn.apache.org/viewvc?rev=1231156view=rev
Log:
[maven-release-plugin] prepare for next development iteration

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1231156r1=1231155r2=1231156view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Fri Jan 13 16:16:29 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1231156r1=1231155r2=1231156view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Fri Jan 13 16:16:29 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1231156r1=1231155r2=1231156view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Fri Jan 13 16:16:29 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1231156r1=1231155r2=1231156view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Fri Jan 13 16:16:29 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 packagingpom/packaging
 
 nameApache James Protocols/name
@@ -45,9 +45,9 @@
 /modules
 
 scm
-
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/connection
-
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/developerConnection
-
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk/tags/protocols-1.6.0?root=Apache-SVN/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk/connection
+
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk/developerConnection
+
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN/url
 /scm
 
 distributionManagement

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1231156r1=1231155r2=1231156view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Fri Jan 13 16:16:29 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1231156r1=1231155r2=1231156view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Fri Jan 13 16:16:29 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 



-
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 Protocols 1.6.0

2012-01-13 Thread Norman Maurer
Hi there,

please use this artifacts for review:
https://repository.apache.org/content/repositories/orgapachejames-064/

Bye,
Norman


2012/1/12 Norman Maurer nor...@apache.org

 Hi there,

 after a lot of more work I think we are ready to release Apache James
 Protocols 1.6.0.

 Artifacts to review:
 https://repository.apache.org/content/repositories/orgapachejames-059/

 Changes:

 https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311060version=12319289

 Please cast your VOTE:

 [ ] +1 Yes, please release
 [ ] +0 No time to review
 [ ] -1 Something is wrong...

 --
 Norman Maurer




[jira] [Created] (PROTOCOLS-87) Add support for APOP

2012-01-12 Thread Norman Maurer (Created) (JIRA)
Add support for APOP


 Key: PROTOCOLS-87
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-87
 Project: JAMES Protocols
  Issue Type: New Feature
  Components: pop3
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
Priority: Minor
 Fix For: 1.6.0


It would be nice to support APOP

--
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: r1230560 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/ pop3/src/main/java/org/apache/james/protocols/pop3/ pop3/src/main/java/org/apache/james/protocols/po

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 14:17:35 2012
New Revision: 1230560

URL: http://svn.apache.org/viewvc?rev=1230560view=rev
Log:
Add support for APOP. See PROTOCOL-87

Added:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractApopCmdHandler.java
Modified:

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

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Session.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractPassCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/WelcomeMessageHandler.java

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java?rev=1230560r1=1230559r2=1230560view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
 Thu Jan 12 14:17:35 2012
@@ -19,6 +19,9 @@
 
 package org.apache.james.protocols.api;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
 
 /**
  * Default implementation of a {@link ProtocolConfiguration} which allows to 
easily set the different configurations. 
@@ -31,14 +34,29 @@ public class ProtocolConfigurationImpl i
 
 private String greeting;
 private String softwareName = JAMES Protocols Server;
-private String helloName = localhost;
+private String helloName = null;
+private static final String DEFAULT_HELLO_NAME;
+
+static {
+String hName;
+try {
+hName = InetAddress.getLocalHost().getHostName();
+} catch (UnknownHostException e) {
+hName = localhost;
+}
+DEFAULT_HELLO_NAME = hName;
+}
 
 /*
+ * 
  * (non-Javadoc)
  * 
  * @see org.apache.james.protocols.pop3.POP3Configuration#getHelloName()
  */
 public String getHelloName() {
+if (helloName == null) {
+return DEFAULT_HELLO_NAME;
+}
 return helloName;
 }
 

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java?rev=1230560r1=1230559r2=1230560view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 Thu Jan 12 14:17:35 2012
@@ -54,24 +54,28 @@ public class POP3ProtocolHandlerChain ex
 }
 
 /**
- * The {@link AbstractPassCmdHandler} to use. If a codenot null/code 
{@link AbstractPassCmdHandler} is given, the {@link POP3ProtocolHandlerChain}
+ * The {@link AbstractPassCmdHandler}'s to use. If at least one {@link 
AbstractPassCmdHandler} is given, the {@link POP3ProtocolHandlerChain}
  * will add all default handlers
  * 
- * @param passHandler
+ * @param authHandlers
  * @throws WiringException 
  */
-public POP3ProtocolHandlerChain(AbstractPassCmdHandler passHandler) throws 
WiringException {
-if (passHandler != null) {
-addAll(initDefaultHandlers(passHandler));  
+public POP3ProtocolHandlerChain(AbstractPassCmdHandler... authHandlers) 
throws WiringException {
+if (authHandlers != null  authHandlers.length  0) {
+addAll(initDefaultHandlers(authHandlers));  
 wireExtensibleHandlers();
 }
 }
 
-protected ListProtocolHandler initDefaultHandlers(AbstractPassCmdHandler 
passHandler) {
+protected ListProtocolHandler 
initDefaultHandlers(AbstractPassCmdHandler... authHandlers) {
 ListProtocolHandler handlers = new ArrayListProtocolHandler();
+// add all pass handlers
+for (AbstractPassCmdHandler handler: authHandlers) {
+handlers.add(handler);
+}
+
 handlers.add(new CapaCmdHandler());
 handlers.add(new UserCmdHandler());
-handlers.add(passHandler);
 handlers.add(new ListCmdHandler());
 handlers.add(new UidlCmdHandler());
 handlers.add(new RsetCmdHandler());

Modified: 
james/protocols

[jira] [Resolved] (PROTOCOLS-87) Add support for APOP

2012-01-12 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-87.


Resolution: Fixed

done

 Add support for APOP
 

 Key: PROTOCOLS-87
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-87
 Project: JAMES Protocols
  Issue Type: New Feature
  Components: pop3
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
Priority: Minor
 Fix For: 1.6.0


 It would be nice to support APOP

--
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: r1230712 - /james/protocols/tags/protocols-imap/

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 19:33:55 2012
New Revision: 1230712

URL: http://svn.apache.org/viewvc?rev=1230712view=rev
Log:
Tag before remove imap code from trunk to release 1.6.0

Added:
james/protocols/tags/protocols-imap/
  - copied from r1230711, 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: r1230719 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 19:43:57 2012
New Revision: 1230719

URL: http://svn.apache.org/viewvc?rev=1230719view=rev
Log:
[maven-release-plugin] prepare release protocols-1.6.0

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1230719r1=1230718r2=1230719view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Thu Jan 12 19:43:57 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1230719r1=1230718r2=1230719view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Thu Jan 12 19:43:57 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1230719r1=1230718r2=1230719view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Thu Jan 12 19:43:57 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1230719r1=1230718r2=1230719view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Thu Jan 12 19:43:57 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 packagingpom/packaging
 
 nameApache James Protocols/name
@@ -45,9 +45,9 @@
 /modules
 
 scm
-
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk/connection
-
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk/developerConnection
-
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/connection
+
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/developerConnection
+
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk/tags/protocols-1.6.0?root=Apache-SVN/url
 /scm
 
 distributionManagement

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1230719r1=1230718r2=1230719view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Thu Jan 12 19:43:57 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1230719r1=1230718r2=1230719view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Thu Jan 12 19:43:57 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 



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



svn commit: r1230720 - /james/protocols/tags/protocols-1.6.0/

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 19:44:18 2012
New Revision: 1230720

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

Added:
james/protocols/tags/protocols-1.6.0/
  - copied from r1230718, james/protocols/trunk/


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



[jira] [Resolved] (PROTOCOLS-65) Add unit tests for POP3Server

2012-01-12 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-65.


Resolution: Fixed

done

 Add unit tests for POP3Server
 -

 Key: PROTOCOLS-65
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-65
 Project: JAMES Protocols
  Issue Type: Task
  Components: pop3
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 We should add more unit tests for POP3

--
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] (PROTOCOLS-82) Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration

2012-01-12 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-82.


Resolution: Fixed

done

 Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration
 -

 Key: PROTOCOLS-82
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-82
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 After refactor more in Protocols I realized that ProtocolHandlerLoader and 
 ProtocolHandlerConfiguration should get removed as they are not needed

--
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] (PROTOCOLS-77) Add abstract base classes for header and body filtering / modification

2012-01-12 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-77.


Resolution: Fixed

done

 Add abstract base classes for header and body filtering / modification
 --

 Key: PROTOCOLS-77
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-77
 Project: JAMES Protocols
  Issue Type: Improvement
  Components: lmtp, smtp
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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] (PROTOCOLS-21) Document protocols web site for 1.4 release

2012-01-12 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-21.


   Resolution: Fixed
Fix Version/s: 1.6.0

done.. Let puplish new javadocs etc on 1.6.0 release

 Document protocols web site for 1.4 release
 ---

 Key: PROTOCOLS-21
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-21
 Project: JAMES Protocols
  Issue Type: Improvement
Reporter: Eric Charles
Assignee: Eric Charles
 Fix For: 1.6.0


 Document protocols web site for 1.4 release

--
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: r1230737 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 19:58:58 2012
New Revision: 1230737

URL: http://svn.apache.org/viewvc?rev=1230737view=rev
Log:
[maven-release-plugin] rollback the release of protocols-1.6.0

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1230737r1=1230736r2=1230737view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Thu Jan 12 19:58:58 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0-RC2-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1230737r1=1230736r2=1230737view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Thu Jan 12 19:58:58 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0-RC2-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1230737r1=1230736r2=1230737view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Thu Jan 12 19:58:58 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0-RC2-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1230737r1=1230736r2=1230737view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Thu Jan 12 19:58:58 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.1-SNAPSHOT/version
+version1.6.0-RC2-SNAPSHOT/version
 packagingpom/packaging
 
 nameApache James Protocols/name

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1230737r1=1230736r2=1230737view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Thu Jan 12 19:58:58 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0-RC2-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1230737r1=1230736r2=1230737view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Thu Jan 12 19:58:58 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.1-SNAPSHOT/version
+version1.6.0-RC2-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 



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



svn commit: r1230738 - /james/protocols/tags/protocols-1.6.0/

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 20:00:39 2012
New Revision: 1230738

URL: http://svn.apache.org/viewvc?rev=1230738view=rev
Log:
Re-roll

Removed:
james/protocols/tags/protocols-1.6.0/


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



svn commit: r1230741 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 20:03:48 2012
New Revision: 1230741

URL: http://svn.apache.org/viewvc?rev=1230741view=rev
Log:
[maven-release-plugin] prepare release protocols-1.6.0

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1230741r1=1230740r2=1230741view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Thu Jan 12 20:03:48 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1230741r1=1230740r2=1230741view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Thu Jan 12 20:03:48 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1230741r1=1230740r2=1230741view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Thu Jan 12 20:03:48 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1230741r1=1230740r2=1230741view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Thu Jan 12 20:03:48 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 packagingpom/packaging
 
 nameApache James Protocols/name
@@ -45,9 +45,9 @@
 /modules
 
 scm
-
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk/connection
-
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk/developerConnection
-
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/connection
+
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/developerConnection
+
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk/tags/protocols-1.6.0?root=Apache-SVN/url
 /scm
 
 distributionManagement

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1230741r1=1230740r2=1230741view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Thu Jan 12 20:03:48 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1230741r1=1230740r2=1230741view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Thu Jan 12 20:03:48 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0-RC2-SNAPSHOT/version
+version1.6.0/version
 relativePath../pom.xml/relativePath
 /parent
 



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



svn commit: r1230742 - /james/protocols/tags/protocols-1.6.0/

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 20:04:39 2012
New Revision: 1230742

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

Added:
james/protocols/tags/protocols-1.6.0/
  - copied from r1230741, 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: r1230743 - in /james/protocols/trunk: api/pom.xml lmtp/pom.xml netty/pom.xml pom.xml pop3/pom.xml smtp/pom.xml

2012-01-12 Thread norman
Author: norman
Date: Thu Jan 12 20:04:55 2012
New Revision: 1230743

URL: http://svn.apache.org/viewvc?rev=1230743view=rev
Log:
[maven-release-plugin] prepare for next development iteration

Modified:
james/protocols/trunk/api/pom.xml
james/protocols/trunk/lmtp/pom.xml
james/protocols/trunk/netty/pom.xml
james/protocols/trunk/pom.xml
james/protocols/trunk/pop3/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=1230743r1=1230742r2=1230743view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Thu Jan 12 20:04:55 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/lmtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/pom.xml?rev=1230743r1=1230742r2=1230743view=diff
==
--- james/protocols/trunk/lmtp/pom.xml (original)
+++ james/protocols/trunk/lmtp/pom.xml Thu Jan 12 20:04:55 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/netty/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/pom.xml?rev=1230743r1=1230742r2=1230743view=diff
==
--- james/protocols/trunk/netty/pom.xml (original)
+++ james/protocols/trunk/netty/pom.xml Thu Jan 12 20:04:55 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1230743r1=1230742r2=1230743view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Thu Jan 12 20:04:55 2012
@@ -28,7 +28,7 @@
 /parent
 
 artifactIdprotocols/artifactId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 packagingpom/packaging
 
 nameApache James Protocols/name
@@ -45,9 +45,9 @@
 /modules
 
 scm
-
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/connection
-
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.0/developerConnection
-
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk/tags/protocols-1.6.0?root=Apache-SVN/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/james/protocols/trunk/connection
+
developerConnectionscm:svn:https://svn.apache.org/repos/asf/james/protocols/trunk/developerConnection
+
urlhttp://svn.apache.org/viewcvs.cgi/james/protocols/trunk?root=Apache-SVN/url
 /scm
 
 distributionManagement

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1230743r1=1230742r2=1230743view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Thu Jan 12 20:04:55 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 

Modified: james/protocols/trunk/smtp/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/pom.xml?rev=1230743r1=1230742r2=1230743view=diff
==
--- james/protocols/trunk/smtp/pom.xml (original)
+++ james/protocols/trunk/smtp/pom.xml Thu Jan 12 20:04:55 2012
@@ -23,7 +23,7 @@
 parent
 artifactIdprotocols/artifactId
 groupIdorg.apache.james/groupId
-version1.6.0/version
+version1.6.1-SNAPSHOT/version
 relativePath../pom.xml/relativePath
 /parent
 



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



[jira] [Updated] (PROTOCOLS-37) Add support for FutureResponse in ProtocolHandlerResponseHandler

2012-01-12 Thread Norman Maurer (Updated) (JIRA)

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

Norman Maurer updated PROTOCOLS-37:
---

Fix Version/s: 2.0.0

 Add support for FutureResponse in ProtocolHandlerResponseHandler
 

 Key: PROTOCOLS-37
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-37
 Project: JAMES Protocols
  Issue Type: Task
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 2.0.0




--
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-75) Move ProtocolSession.newFatalErrorResponse() and ProtocolSession.newLineToLongResponse() to an extra interface

2012-01-12 Thread Norman Maurer (Updated) (JIRA)

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

Norman Maurer updated PROTOCOLS-75:
---

Fix Version/s: (was: 1.6.0)
   2.0.0

 Move ProtocolSession.newFatalErrorResponse() and 
 ProtocolSession.newLineToLongResponse() to an extra interface
 --

 Key: PROTOCOLS-75
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-75
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 2.0.0




--
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-68) Add sievemanager as protocols module

2012-01-12 Thread Norman Maurer (Updated) (JIRA)

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

Norman Maurer updated PROTOCOLS-68:
---

Fix Version/s: 2.0.0

 Add sievemanager as protocols module
 

 Key: PROTOCOLS-68
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-68
 Project: JAMES Protocols
  Issue Type: Task
  Components: sieve
Reporter: Norman Maurer
 Fix For: 2.0.0


 A Protocol for Remotely Managing Sieve Scripts
 http://tools.ietf.org/html/rfc5804
 This sounds really interesting and should be really easy to implement with 
 the protocols-api. Futhermore we could reuse our jsieve project for the 
 parsing etc.

--
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 Protocols 1.6.0

2012-01-12 Thread Norman Maurer
Hi there,

after a lot of more work I think we are ready to release Apache James Protocols 
1.6.0.

Artifacts to review:
https://repository.apache.org/content/repositories/orgapachejames-059/ 

Changes:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311060version=12319289

Please cast your VOTE:

[ ] +1 Yes, please release
[ ] +0 No time to review
[ ] -1 Something is wrong...

-- 
Norman Maurer



svn commit: r1230905 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java

2012-01-12 Thread norman
Author: norman
Date: Fri Jan 13 06:50:46 2012
New Revision: 1230905

URL: http://svn.apache.org/viewvc?rev=1230905view=rev
Log:
Adjust for latest protocols changes

Modified:

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java?rev=1230905r1=1230904r2=1230905view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
 Fri Jan 13 06:50:46 2012
@@ -52,6 +52,7 @@ public class PassCmdHandler extends Abst
 this.manager = manager;
 }
 
+@Override
 public Response onCommand(POP3Session session, Request request) {
 Response response =  super.onCommand(session, request);
 if (POP3Response.OK_RESPONSE.equals(response.getRetCode())) {
@@ -62,7 +63,7 @@ public class PassCmdHandler extends Abst
 
 
 @Override
-protected Mailbox auth(POP3Session session, String password) throws 
Exception {
+protected Mailbox auth(POP3Session session, String username, String 
password) throws Exception {
 MailboxSession mSession = null;
 try {
 mSession = manager.login(session.getUser(), password, new 
Slf4jLoggerAdapter(session.getLogger()));



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



svn commit: r1230046 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/ api/src/test/java/org/apache/james/protocols/api/ netty/src/main/java/org/apache/james/protocols/net

2012-01-11 Thread norman
Author: norman
Date: Wed Jan 11 14:03:27 2012
New Revision: 1230046

URL: http://svn.apache.org/viewvc?rev=1230046view=rev
Log:
Move SMTPSession.pushLineHandler(..) and SMTPSession.popLineHandler(..) to the 
ProtocolSession interface. See PROTOCOLS-85

Modified:

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

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

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

james/protocols/trunk/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java

james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSession.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSessionImpl.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java?rev=1230046r1=1230045r2=1230046view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
 Wed Jan 11 14:03:27 2012
@@ -23,6 +23,7 @@ import java.net.InetSocketAddress;
 import java.nio.charset.Charset;
 import java.util.Map;
 
+import org.apache.james.protocols.api.handler.LineHandler;
 import org.apache.james.protocols.api.logger.Logger;
 
 /**
@@ -173,5 +174,22 @@ public interface ProtocolSession {
  * @return delimiter
  */
 String getLineDelimiter();
+
+/**
+ * Put a new line handler in the chain
+ * @param overrideCommandHandler
+ */
+T extends ProtocolSession void pushLineHandler(LineHandlerT 
overrideCommandHandler);
+
+/**
+ * Pop the last command handler 
+ */
+void popLineHandler();
+
+/**
+ * Return the size of the pushed {@link LineHandler}
+ * @return size of the pushed line handler
+ */
+int getPushedLineHandlerCount();
 
 }

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java?rev=1230046r1=1230045r2=1230046view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
 Wed Jan 11 14:03:27 2012
@@ -26,6 +26,7 @@ import java.util.Map;
 
 
 import org.apache.james.protocols.api.ProtocolTransport;
+import org.apache.james.protocols.api.handler.LineHandler;
 import org.apache.james.protocols.api.logger.Logger;
 import org.apache.james.protocols.api.logger.ProtocolSessionLogger;
 
@@ -215,4 +216,28 @@ public class ProtocolSessionImpl impleme
 return DELIMITER;
 }
 
+/*
+ * (non-Javadoc)
+ * @see org.apache.james.protocols.api.ProtocolSession#popLineHandler()
+ */
+public void popLineHandler() {
+transport.popLineHandler();
+}
+
+/*
+ * (non-Javadoc)
+ * @see 
org.apache.james.protocols.api.ProtocolSession#getPushedLineHandlerCount()
+ */
+public int getPushedLineHandlerCount() {
+return transport.getPushedLineHandlerCount();
+}
+
+/*
+ * (non-Javadoc)
+ * @see 
org.apache.james.protocols.api.ProtocolSession#pushLineHandler(org.apache.james.protocols.api.handler.LineHandler)
+ */
+public T extends ProtocolSession void pushLineHandler(LineHandlerT 
overrideCommandHandler) {
+transport.pushLineHandler(overrideCommandHandler, this);
+}
+
 }

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java?rev=1230046r1=1230045r2=1230046view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java
 Wed Jan 11 14:03:27 2012
@@ -88,7 +88,7 @@ public interface ProtocolTransport {
  * @param overrideCommandHandler
  * @param session
  */
-T extends ProtocolSession void

[jira] [Created] (PROTOCOLS-85) Move SMTPSession.pushLineHandler(..) and SMTPSession.popLineHandler(..) to the ProtocolSession interface

2012-01-11 Thread Norman Maurer (Created) (JIRA)
Move SMTPSession.pushLineHandler(..) and SMTPSession.popLineHandler(..) to the 
ProtocolSession interface


 Key: PROTOCOLS-85
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-85
 Project: JAMES Protocols
  Issue Type: Task
  Components: api, smtp
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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: r1230047 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/ api/src/main/java/org/apache/james/protocols/api/future/ api/src/main/java/org/apache/james/protocol

2012-01-11 Thread norman
Author: norman
Date: Wed Jan 11 14:04:02 2012
New Revision: 1230047

URL: http://svn.apache.org/viewvc?rev=1230047view=rev
Log:
Cleanup and javadocs

Modified:

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

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

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

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStreamResponseImpl.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerResultHandler.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/UnknownCommandHandler.java

james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/HandlerConstants.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java?rev=1230047r1=1230046r2=1230047view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java
 Wed Jan 11 14:04:02 2012
@@ -19,6 +19,11 @@
 
 package org.apache.james.protocols.api;
 
+/**
+ * Configuration which is used in scope of a Protocol
+ * 
+ *
+ */
 public interface ProtocolConfiguration {
 
 

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java?rev=1230047r1=1230046r2=1230047view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
 Wed Jan 11 14:04:02 2012
@@ -20,7 +20,15 @@
 package org.apache.james.protocols.api;
 
 
+/**
+ * Default implementation of a {@link ProtocolConfiguration} which allows to 
easily set the different configurations. 
+ * 
+ * Be aware that set and get operations are not thread-safe
+ * 
+ *
+ */
 public class ProtocolConfigurationImpl implements ProtocolConfiguration {
+
 private String greeting;
 private String softwareName = JAMES Protocols Server;
 private String helloName = localhost;

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java?rev=1230047r1=1230046r2=1230047view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java
 Wed Jan 11 14:04:02 2012
@@ -21,6 +21,10 @@ package org.apache.james.protocols.api;
 import java.net.InetSocketAddress;
 import java.util.List;
 
+/**
+ * A {@link ProtocolServer} accept inbound traffic and handle it. Basically 
the protocols API can be used to handle every line based protocol in an easy 
fashion
+ *
+ */
 public interface ProtocolServer {
 
 /**

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java?rev=1230047r1=1230046r2=1230047view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java
 Wed Jan 11 14:04:02 2012
@@ -22,6 +22,11 @@ package org.apache.james.protocols.api.f
 import org.apache.james.protocols.api.Response;
 import org.apache.james.protocols.api.StartTlsResponse;
 
+/**
+ * Special {@link FutureResponse} which will get notified once a {@link 
StartTlsResponse} is ready
+ * 
+ *
+ */
 public class FutureStartTlsResponse extends FutureResponseImpl implements 
StartTlsResponse

svn commit: r1230048 - /james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java

2012-01-11 Thread norman
Author: norman
Date: Wed Jan 11 14:06:32 2012
New Revision: 1230048

URL: http://svn.apache.org/viewvc?rev=1230048view=rev
Log:
cleanup

Modified:

james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java

Modified: 
james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java?rev=1230048r1=1230047r2=1230048view=diff
==
--- 
james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java
 (original)
+++ 
james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java
 Wed Jan 11 14:06:32 2012
@@ -195,7 +195,7 @@ public class NettyProtocolTransport exte
 // it is executed with the same ExecutorHandler as the coreHandler (if 
one exist)
 // 
 // See JAMES-1277
-channel.getPipeline().addBefore(coreHandler, lineHandler + 
lineHandlerCount, new LineHandlerUpstreamHandler(session, 
overrideCommandHandler));
+channel.getPipeline().addBefore(HandlerConstants.CORE_HANDLER, 
lineHandler + lineHandlerCount, new LineHandlerUpstreamHandler(session, 
overrideCommandHandler));
 }
 
 }



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



svn commit: r1230066 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/ lmtp/src/main/java/org/apache/james/protocols/lmtp/ lmtp/src/main/java/org/apache/james/protocols/lm

2012-01-11 Thread norman
Author: norman
Date: Wed Jan 11 14:33:52 2012
New Revision: 1230066

URL: http://svn.apache.org/viewvc?rev=1230066view=rev
Log:
More cleanup

Removed:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/TemporaryResolutionException.java
Modified:

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

james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java

james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfigurationImpl.java

james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java

james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/ReceivedDataLineFilter.java

james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/WelcomeMessageHandler.java

james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/hook/DeliverToRecipientHook.java

james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Configuration.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Protocol.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StreamResponse.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/MailboxFactory.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/MessageMetaData.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelope.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPConfigurationImpl.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSession.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java?rev=1230066r1=1230065r2=1230066view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java
 Wed Jan 11 14:33:52 2012
@@ -29,7 +29,8 @@ import java.io.InputStream;
 public interface StreamResponse extends Response{
 
 /**
- * Return the stream which needs to get written to the remote peer
+ * Return the stream which needs to get written to the remote peer. This 
method should only be called one time (when the data is written to the client) 
as it returns
+ * the same {@link InputStream} on every call. So once it is consumed 
there is no way to re-process it.
  * 
  * @return stream
  */

Modified: 
james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java?rev=1230066r1=1230065r2=1230066view=diff
==
--- 
james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java
 (original)
+++ 
james/protocols/trunk/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java
 Wed Jan 11 14:33:52 2012
@@ -21,38 +21,38 @@ package org.apache.james.protocols.lmtp;
 import org.apache.james.protocols.api.ProtocolConfigurationImpl;
 import org.apache.james.protocols.smtp.SMTPConfiguration;
 
+
+/**
+ * A {@link ProtocolConfigurationImpl} which is used in the context of LMTP
+ *
+ */
 public abstract class LMTPConfiguration extends ProtocolConfigurationImpl 
implements SMTPConfiguration{
 
-public LMTPConfiguration() {
-setSoftwareName(JAMES Protocols LMTP Server);
-}
-/*
- * (non-Javadoc)
- * @see 
org.apache.james.protocols.smtp.SMTPConfiguration#isRelayingAllowed(java.lang.String)
+
+
+/**
+ * Return codefalse/code
  */
 public boolean isRelayingAllowed(String remoteIP) {
 return false;
 }
 
-/*
- * (non-Javadoc)
- * @see 
org.apache.james.protocols.smtp.SMTPConfiguration#isAuthRequired(java.lang.String)
+/**
+ * Return codefalse/code
  */
 public boolean isAuthRequired(String remoteIP) {
 return false;
 }
 
-/*
- * (non-Javadoc

[jira] [Created] (PROTOCOLS-86) Remove MailboxFactory

2012-01-11 Thread Norman Maurer (Created) (JIRA)
Remove MailboxFactory
-

 Key: PROTOCOLS-86
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-86
 Project: JAMES Protocols
  Issue Type: Task
  Components: pop3
Affects Versions: 1.6.0
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


We should better remove the MailboxFactory class and just make PassCmdHandler 
abstract. This removes one interface and makes things more clear as this 
interface was only used by PassCmdHandler anyway

--
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] (PROTOCOLS-86) Remove MailboxFactory

2012-01-11 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-86.


Resolution: Fixed

done

 Remove MailboxFactory
 -

 Key: PROTOCOLS-86
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-86
 Project: JAMES Protocols
  Issue Type: Task
  Components: pop3
Affects Versions: 1.6.0
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 We should better remove the MailboxFactory class and just make PassCmdHandler 
 abstract. This removes one interface and makes things more clear as this 
 interface was only used by PassCmdHandler anyway

--
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: r1230082 - in /james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3: StartTlsPop3Response.java core/StlsCmdHandler.java

2012-01-11 Thread norman
Author: norman
Date: Wed Jan 11 15:03:21 2012
New Revision: 1230082

URL: http://svn.apache.org/viewvc?rev=1230082view=rev
Log:
Rename StartTlsPop3Response to POP3StartTlsResponse to be more inline with the 
rest of the class namings

Removed:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/StartTlsPop3Response.java
Modified:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java?rev=1230082r1=1230081r2=1230082view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
 Wed Jan 11 15:03:21 2012
@@ -30,7 +30,7 @@ import org.apache.james.protocols.api.Re
 import org.apache.james.protocols.api.handler.CommandHandler;
 import org.apache.james.protocols.pop3.POP3Response;
 import org.apache.james.protocols.pop3.POP3Session;
-import org.apache.james.protocols.pop3.StartTlsPop3Response;
+import org.apache.james.protocols.pop3.POP3StartTlsResponse;
 
 /**
  * Handler which offer STARTTLS implementation for POP3. STARTTLS is started
@@ -40,7 +40,7 @@ public class StlsCmdHandler implements C
 private static final CollectionString COMMANDS = 
Collections.unmodifiableCollection(Arrays.asList(STLS));
 private static final SetString CAPS = Collections.unmodifiableSet(new 
HashSetString(Arrays.asList(STLS)));
 
-private static final Response BEGIN_TLS = new 
StartTlsPop3Response(POP3Response.OK_RESPONSE, Begin TLS 
negotiation).immutable();
+private static final Response BEGIN_TLS = new 
POP3StartTlsResponse(POP3Response.OK_RESPONSE, Begin TLS 
negotiation).immutable();
 /**
  * @see 
CommandHandler#onCommand(org.apache.james.protocols.api.ProtocolSession, 
Request)
  */



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



[jira] [Resolved] (PROTOCOLS-85) Move SMTPSession.pushLineHandler(..) and SMTPSession.popLineHandler(..) to the ProtocolSession interface

2012-01-11 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-85.


Resolution: Fixed

done

 Move SMTPSession.pushLineHandler(..) and SMTPSession.popLineHandler(..) to 
 the ProtocolSession interface
 

 Key: PROTOCOLS-85
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-85
 Project: JAMES Protocols
  Issue Type: Task
  Components: api, smtp
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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: r1230094 - in /james/server/trunk/pop3server/src: main/java/org/apache/james/pop3server/core/ main/java/org/apache/james/pop3server/mailbox/ main/java/org/apache/james/pop3server/netty/ te

2012-01-11 Thread norman
Author: norman
Date: Wed Jan 11 15:35:28 2012
New Revision: 1230094

URL: http://svn.apache.org/viewvc?rev=1230094view=rev
Log:
Adjust for latest protocols changes

Added:

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
Removed:

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/WelcomeMessageHandler.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java
Modified:

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3Server.java

james/server/trunk/pop3server/src/test/java/org/apache/james/pop3server/POP3ServerTest.java

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java?rev=1230094r1=1230093r2=1230094view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
 Wed Jan 11 15:35:28 2012
@@ -37,12 +37,13 @@ import org.apache.james.protocols.pop3.c
 import org.apache.james.protocols.pop3.core.UidlCmdHandler;
 import org.apache.james.protocols.pop3.core.UnknownCmdHandler;
 import org.apache.james.protocols.pop3.core.UserCmdHandler;
+import org.apache.james.protocols.pop3.core.WelcomeMessageHandler;
 
 public class CoreCmdHandlerLoader implements HandlersPackage {
 
 private final static String CAPACMDHANDLER = 
CapaCmdHandler.class.getName();
 private final static String USERCMDHANDLER = 
UserCmdHandler.class.getName();
-private final static String PASSCMDHANDLER = 
JamesPassCmdHandler.class.getName();
+private final static String PASSCMDHANDLER = 
PassCmdHandler.class.getName();
 private final static String LISTCMDHANDLER = 
ListCmdHandler.class.getName();
 private final static String UIDLCMDHANDLER = 
UidlCmdHandler.class.getName();
 private final static String RSETCMDHANDLER = 
RsetCmdHandler.class.getName();

Added: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java?rev=1230094view=auto
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
 (added)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
 Wed Jan 11 15:35:28 2012
@@ -0,0 +1,90 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+package org.apache.james.pop3server.core;
+
+import java.io.IOException;
+
+import javax.annotation.Resource;
+
+import org.apache.james.mailbox.BadCredentialsException;
+import org.apache.james.mailbox.MailboxException;
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxPath;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageManager;
+import org.apache.james.pop3server.mailbox.MailboxAdapter;
+import org.apache.james.protocols.api.Request;
+import org.apache.james.protocols.api.Response;
+import org.apache.james.protocols.lib.POP3BeforeSMTPHelper;
+import

[RESULT] [VOTE] Release Apache James Mime4j 0.7.2

2012-01-11 Thread Norman Maurer
Hi there,

the VOTE passed!

Result:

+1 Manuel*, Felix, Eric*, Norman*
+0 Andrey, Ioan, Vincenzo*

* Binding

Thanks to everyone who voted. I pushed the release to maven central and
also to the mirrors. We should update the website once the mirrors are
synced.

Bye,
Norman


2012/1/8 Norman Maurer norman.mau...@googlemail.com



 -- Forwarded message --
 From: Norman Maurer norman.mau...@googlemail.com
 Date: 2012/1/8
 Subject: [VOTE] Release Apache James Mime4j 0.7.2
 To: James Developers List server-dev@james.apache.org


 Hi there,

 its time again for a new release of Apache James Mime4j 0.7.2.

 Changelog:

 https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truejqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.2%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESCmode=hide

 Artifacts:
 https://repository.apache.org/content/repositories/orgapachejames-030/

 [ ] +1 Yes please release
 [ ] +0 No time to review
 [ ] -1 Something wrong with the release

 Thanks,
 Norman





Re: [VOTE] Release Apache James Mime4j 0.7.2

2012-01-10 Thread Norman Maurer
 [x] +1 Yes please release

-- 
Norman Maurer


Am Sonntag, 8. Januar 2012 um 20:28 schrieb Norman Maurer:

 
 
 -- Forwarded message --
 From: Norman Maurer norman.mau...@googlemail.com 
 (mailto:norman.mau...@googlemail.com)
 Date: 2012/1/8
 Subject: [VOTE] Release Apache James Mime4j 0.7.2
 To: James Developers List server-dev@james.apache.org 
 (mailto:server-dev@james.apache.org)
 
 
 Hi there,
 
 its time again for a new release of Apache James Mime4j 0.7.2.  
 
 Changelog:
 https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truejqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.2%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESCmode=hide
 
 Artifacts:
 https://repository.apache.org/content/repositories/orgapachejames-030/
 
 [ ] +1 Yes please release
 [ ] +0 No time to review
 [ ] -1 Something wrong with the release
 
 Thanks,
 Norman
 
 



[VOTE] Release Apache James Mime4j 0.7.2

2012-01-08 Thread Norman Maurer
Hi there,

its time again for a new release of Apache James Mime4j 0.7.2.

Changelog:
https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truejqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.2%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESCmode=hide

Artifacts:
https://repository.apache.org/content/repositories/orgapachejames-030/

[ ] +1 Yes please release
[ ] +0 No time to review
[ ] -1 Something wrong with the release

Thanks,
Norman


Fwd: [VOTE] Release Apache James Mime4j 0.7.2

2012-01-08 Thread Norman Maurer
-- Forwarded message --
From: Norman Maurer norman.mau...@googlemail.com
Date: 2012/1/8
Subject: [VOTE] Release Apache James Mime4j 0.7.2
To: James Developers List server-dev@james.apache.org


Hi there,

its time again for a new release of Apache James Mime4j 0.7.2.

Changelog:
https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truejqlQuery=project+%3D+MIME4J+AND+fixVersion+%3D+%220.7.2%22+AND+status+%3D+Resolved+ORDER+BY+priority+DESCmode=hide

Artifacts:
https://repository.apache.org/content/repositories/orgapachejames-030/

[ ] +1 Yes please release
[ ] +0 No time to review
[ ] -1 Something wrong with the release

Thanks,
Norman


[jira] [Resolved] (MAILETSTANDARD-11) PostmasterAlias mailet overrides local postmaster@ user when it exists

2012-01-08 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved MAILETSTANDARD-11.
-

   Resolution: Fixed
Fix Version/s: 1.1
 Assignee: Norman Maurer

Fixed. Thanks for reporting

 PostmasterAlias mailet overrides local postmaster@ user when it exists
 --

 Key: MAILETSTANDARD-11
 URL: https://issues.apache.org/jira/browse/MAILETSTANDARD-11
 Project: JAMES Standard Mailets
  Issue Type: Bug
Affects Versions: 1.0
Reporter: Andrzej Rusin
Assignee: Norman Maurer
Priority: Minor
 Fix For: 1.1


 I think there's a glitch in the PostmasterAlias mailet. In my opinion there 
 should be NOT:
 if (addr.getLocalPart().equalsIgnoreCase(postmaster) 
 mailetContext.isLocalServer(addr.getDomain())) {
 but
 if (addr.getLocalPart().equalsIgnoreCase(postmaster) 
 mailetContext.isLocalServer(addr.getDomain()) 
 ! mailetContext.isLocalEmail(addr) {
 which means, if you have a valid postmaster@given_domain user, it should not 
 get aliased.
 It's quite important in virtual/multi-domain environment.

--
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: r1228946 - /james/mailet/standard/trunk/src/main/java/org/apache/james/transport/mailets/PostmasterAlias.java

2012-01-08 Thread norman
Author: norman
Date: Sun Jan  8 20:33:54 2012
New Revision: 1228946

URL: http://svn.apache.org/viewvc?rev=1228946view=rev
Log:
Use the postmaster@ for the domain if present. If not fallback to default 
postmaster account. See MAILETSTANDARD-11

Modified:

james/mailet/standard/trunk/src/main/java/org/apache/james/transport/mailets/PostmasterAlias.java

Modified: 
james/mailet/standard/trunk/src/main/java/org/apache/james/transport/mailets/PostmasterAlias.java
URL: 
http://svn.apache.org/viewvc/james/mailet/standard/trunk/src/main/java/org/apache/james/transport/mailets/PostmasterAlias.java?rev=1228946r1=1228945r2=1228946view=diff
==
--- 
james/mailet/standard/trunk/src/main/java/org/apache/james/transport/mailets/PostmasterAlias.java
 (original)
+++ 
james/mailet/standard/trunk/src/main/java/org/apache/james/transport/mailets/PostmasterAlias.java
 Sun Jan  8 20:33:54 2012
@@ -57,7 +57,7 @@ public class PostmasterAlias extends Gen
 for (IteratorMailAddress i = recipients.iterator(); i.hasNext(); ) {
 MailAddress addr = (MailAddress)i.next();
 if (addr.getLocalPart().equalsIgnoreCase(postmaster) 
-mailetContext.isLocalServer(addr.getDomain())) {
+mailetContext.isLocalServer(addr.getDomain())  
!mailetContext.isLocalEmail(addr)) {
 //Should remove this address... we want to replace it with
 //  the server's postmaster address
 if (recipientsToRemove == null) {



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



[jira] [Created] (JAMES-1363) Allow to disable auto-timeout

2012-01-08 Thread Norman Maurer (Created) (JIRA)
Allow to disable auto-timeout
-

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


It should be possible to disable the auto-logout-timer in imap, as it is not a 
MUST. If enabled we MUST only accept values = 30 min.

--
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: r1228949 - /james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java

2012-01-08 Thread norman
Author: norman
Date: Sun Jan  8 20:39:25 2012
New Revision: 1228949

URL: http://svn.apache.org/viewvc?rev=1228949view=rev
Log:
Allow to disable the auto-logout-timer in imap. See JAMES-1363

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=1228949r1=1228948r2=1228949view=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
 Sun Jan  8 20:39:25 2012
@@ -71,13 +71,18 @@ public class IMAPServer extends Abstract
 private boolean plainAuthDisallowed;
 
 
-
+private int timeout;
+
 // Use a big default
 public final static int DEFAULT_MAX_LINE_LENGTH = 65536;
 
 // Use 10MB as default
 public final static int DEFAULT_IN_MEMORY_SIZE_LIMIT = 10485760;
 
+// default timeout is 30 seconds
+public final static int DEFAULT_TIMEOUT = 30 * 60;
+
+
 @Resource(name = imapDecoder)
 public void setImapDecoder(ImapDecoder decoder) {
 this.decoder = decoder;
@@ -101,6 +106,10 @@ public class IMAPServer extends Abstract
 maxLineLength = configuration.getInt(maxLineLength, 
DEFAULT_MAX_LINE_LENGTH);
 inMemorySizeLimit = configuration.getInt(inMemorySizeLimit, 
DEFAULT_IN_MEMORY_SIZE_LIMIT);
 plainAuthDisallowed = configuration.getBoolean(plainAuthDisallowed, 
false);
+timeout = configuration.getInt(timeout, DEFAULT_TIMEOUT);
+if (timeout  DEFAULT_TIMEOUT) {
+throw new ConfigurationException(Minimum timeout of 30 minutes 
required. See rfc2060 5.4 for details);
+}
 }
 
 /**
@@ -124,14 +133,12 @@ public class IMAPServer extends Abstract
 private final ChannelGroupHandler groupHandler = new 
ChannelGroupHandler(group);
 private final HashedWheelTimer timer = new HashedWheelTimer();
 
-// Timeout of 30 minutes See rfc2060 5.4 for details
-private final static int TIMEOUT = 60 * 30;
 private final TimeUnit TIMEOUT_UNIT = TimeUnit.SECONDS;
 
 public ChannelPipeline getPipeline() throws Exception {
 ChannelPipeline pipeline = pipeline();
 pipeline.addLast(GROUP_HANDLER, groupHandler);
-pipeline.addLast(idleHandler, new IdleStateHandler(timer, 0, 
0, 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



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

2012-01-08 Thread norman
Author: norman
Date: Sun Jan  8 20:40:02 2012
New Revision: 1228950

URL: http://svn.apache.org/viewvc?rev=1228950view=rev
Log:
Allow to disable the auto-logout-timer in imap. See JAMES-1363

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=1228950r1=1228949r2=1228950view=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
 Sun Jan  8 20:40:02 2012
@@ -110,6 +110,9 @@ public class IMAPServer extends Abstract
 if (timeout  DEFAULT_TIMEOUT) {
 throw new ConfigurationException(Minimum timeout of 30 minutes 
required. See rfc2060 5.4 for details);
 }
+if (timeout  0) {
+timeout = 0;
+}
 }
 
 /**



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



[jira] [Resolved] (JAMES-1363) Allow to disable auto-timeout

2012-01-08 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved JAMES-1363.
--

Resolution: Fixed

Done. Its now possible to disable it with:
timeout0/timeout

 Allow to disable auto-timeout
 -

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


 It should be possible to disable the auto-logout-timer in imap, as it is not 
 a MUST. If enabled we MUST only accept values = 30 min.

--
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: r1229040 - /james/protocols/trunk/pop3/

2012-01-08 Thread norman
Author: norman
Date: Mon Jan  9 06:34:49 2012
New Revision: 1229040

URL: http://svn.apache.org/viewvc?rev=1229040view=rev
Log:
add svn:ignore

Modified:
james/protocols/trunk/pop3/   (props changed)

Propchange: james/protocols/trunk/pop3/
--
--- svn:ignore (original)
+++ svn:ignore Mon Jan  9 06:34:49 2012
@@ -1,7 +1,5 @@
 target
-
 .project
-
 .classpath
-
 .settings
+bin



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



[jira] [Commented] (JAMES-1360) Use protocols 1.6.0-RC2-SNAPSHOT

2012-01-07 Thread Norman Maurer (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-1360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13181899#comment-13181899
 ] 

Norman Maurer commented on JAMES-1360:
--

I will have a look later today...

 Use protocols 1.6.0-RC2-SNAPSHOT
 

 Key: JAMES-1360
 URL: https://issues.apache.org/jira/browse/JAMES-1360
 Project: JAMES Server
  Issue Type: New Feature
Affects Versions: Trunk
Reporter: Eric Charles
Assignee: Eric Charles
 Fix For: 3.0-beta4


 There are a bunch of API changes between protocols-1.6-beta3 and 
 protocols-1.6.0-RC2-SNAPSHOT.
 We need to update server code (mainly pop3/imap/smtp server projects) to 
 align to the current protocols implementation.

--
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: r1228617 - /james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 14:04:52 2012
New Revision: 1228617

URL: http://svn.apache.org/viewvc?rev=1228617view=rev
Log:
Fix JamesPassCmdHandler. This is part of JAMES-1360

Modified:

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java?rev=1228617r1=1228616r2=1228617view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
 Sat Jan  7 14:04:52 2012
@@ -18,10 +18,13 @@
  /
 package org.apache.james.pop3server.core;
 
+import java.util.Collection;
+
 import javax.annotation.Resource;
 
 import org.apache.james.protocols.api.Request;
 import org.apache.james.protocols.api.Response;
+import org.apache.james.protocols.api.handler.CommandHandler;
 import org.apache.james.protocols.lib.POP3BeforeSMTPHelper;
 import org.apache.james.protocols.pop3.POP3Response;
 import org.apache.james.protocols.pop3.POP3Session;
@@ -32,27 +35,29 @@ import org.apache.james.protocols.pop3.m
  * {@link PassCmdHandler} which also handles POP3 Before SMTP
  * 
  */
-public class JamesPassCmdHandler extends PassCmdHandler {
+public class JamesPassCmdHandler implements CommandHandlerPOP3Session {
 
-// TODO fix me as a final field...
-private MailboxFactory factory;
+private PassCmdHandler handler;
 
 public JamesPassCmdHandler() {
-super(null);
 }
 
 @Resource(name = mailboxfactory)
 public void setMailboxFactory(MailboxFactory factory) {
-this.factory = factory;
+this.handler = new PassCmdHandler(factory);
 }
 
-@Override
 public Response onCommand(POP3Session session, Request request) {
-Response response =  super.onCommand(session, request);
+Response response =  handler.onCommand(session, request);
 if (POP3Response.OK_RESPONSE.equals(response.getRetCode())) {
 
POP3BeforeSMTPHelper.addIPAddress(session.getRemoteAddress().getAddress().toString());
 }
 return response;
 }
-
+
+@Override
+public CollectionString getImplCommands() {
+return handler.getImplCommands();
+}
+
 }



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



svn commit: r1228620 - in /james/server/trunk: pop3server/src/main/java/org/apache/james/pop3server/core/ pop3server/src/main/java/org/apache/james/pop3server/jmx/ protocols-library/src/main/java/org/

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 14:23:57 2012
New Revision: 1228620

URL: http://svn.apache.org/viewvc?rev=1228620view=rev
Log:
Fix class-cast exception which was introduced by JAMES-1360

Modified:

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/CommandHandlerResultJMXMonitor.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/POP3CommandHandlerStats.java

james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerResultJMXMonitor.java

james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/jmx/AbstractCommandHandlerStats.java

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java?rev=1228620r1=1228619r2=1228620view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/CoreCmdHandlerLoader.java
 Sat Jan  7 14:23:57 2012
@@ -59,7 +59,7 @@ public class CoreCmdHandlerLoader implem
 private final static String COMMANDDISPATCHER = 
CommandDispatcher.class.getName();
 
 // logging stuff
-private final String COMMANDHANDLERRESULTLOGGER = 
POP3CommandHandlerResultLogger.class.getName();
+private final static String COMMANDHANDLERRESULTLOGGER = 
POP3CommandHandlerResultLogger.class.getName();
 
 
 private final ListString commands = new LinkedListString();

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java?rev=1228620r1=1228619r2=1228620view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/core/JamesPassCmdHandler.java
 Sat Jan  7 14:23:57 2012
@@ -50,7 +50,7 @@ public class JamesPassCmdHandler impleme
 public Response onCommand(POP3Session session, Request request) {
 Response response =  handler.onCommand(session, request);
 if (POP3Response.OK_RESPONSE.equals(response.getRetCode())) {
-
POP3BeforeSMTPHelper.addIPAddress(session.getRemoteAddress().getAddress().toString());
+
POP3BeforeSMTPHelper.addIPAddress(session.getRemoteAddress().getAddress().getHostAddress());
 }
 return response;
 }

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/CommandHandlerResultJMXMonitor.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/CommandHandlerResultJMXMonitor.java?rev=1228620r1=1228619r2=1228620view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/CommandHandlerResultJMXMonitor.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/jmx/CommandHandlerResultJMXMonitor.java
 Sat Jan  7 14:23:57 2012
@@ -25,19 +25,18 @@ import org.apache.james.protocols.api.ha
 import org.apache.james.protocols.api.handler.LifecycleAwareProtocolHandler;
 import 
org.apache.james.protocols.lib.jmx.AbstractCommandHandlerResultJMXMonitor;
 import org.apache.james.protocols.lib.jmx.AbstractCommandHandlerStats;
-import org.apache.james.protocols.pop3.POP3Response;
 import org.apache.james.protocols.pop3.POP3Session;
 
 /**
  * Gather JMX stats for {@link CommandHandler}
  */
-public class CommandHandlerResultJMXMonitor extends 
AbstractCommandHandlerResultJMXMonitorPOP3Response, POP3Session implements 
LifecycleAwareProtocolHandler {
+public class CommandHandlerResultJMXMonitor extends 
AbstractCommandHandlerResultJMXMonitorPOP3Session implements 
LifecycleAwareProtocolHandler {
 
 /**
  * @see 
org.apache.james.protocols.lib.jmx.AbstractCommandHandlerResultJMXMonitor
  * 
#createCommandHandlerStats(org.apache.james.protocols.api.CommandHandler)
  */
-protected AbstractCommandHandlerStatsPOP3Response 
createCommandHandlerStats(CommandHandlerPOP3Session handler) throws Exception 
{
+protected AbstractCommandHandlerStats 
createCommandHandlerStats(CommandHandlerPOP3Session handler

svn commit: r1228621 - in /james/server/trunk: pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java protocols-library/src/main/java/org/apache/james/protocols/lib/Slf4

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 14:31:52 2012
New Revision: 1228621

URL: http://svn.apache.org/viewvc?rev=1228621view=rev
Log:
move the logger adapter to protocols-library module

Added:

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

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java?rev=1228621r1=1228620r2=1228621view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mailbox/JamesMailboxFactory.java
 Sat Jan  7 14:31:52 2012
@@ -28,7 +28,7 @@ import org.apache.james.mailbox.MailboxM
 import org.apache.james.mailbox.MailboxPath;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageManager;
-import org.apache.james.protocols.api.logger.Slf4jLoggerAdapter;
+import org.apache.james.protocols.lib.Slf4jLoggerAdapter;
 import org.apache.james.protocols.pop3.POP3Session;
 import org.apache.james.protocols.pop3.mailbox.Mailbox;
 import org.apache.james.protocols.pop3.mailbox.MailboxFactory;

Added: 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/Slf4jLoggerAdapter.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/Slf4jLoggerAdapter.java?rev=1228621view=auto
==
--- 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/Slf4jLoggerAdapter.java
 (added)
+++ 
james/server/trunk/protocols-library/src/main/java/org/apache/james/protocols/lib/Slf4jLoggerAdapter.java
 Sat Jan  7 14:31:52 2012
@@ -0,0 +1,320 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.protocols.lib;
+
+import org.apache.james.protocols.api.logger.Logger;
+import org.slf4j.Marker;
+
+/**
+ * Adapter class for SLF4J
+ *
+ */
+public class Slf4jLoggerAdapter implements org.slf4j.Logger {
+
+private final Logger logger;
+
+public Slf4jLoggerAdapter(Logger logger) {
+this.logger = logger;
+}
+
+public boolean isDebugEnabled() {
+return logger.isDebugEnabled();
+}
+
+public boolean isErrorEnabled() {
+return logger.isErrorEnabled();
+}
+public boolean isInfoEnabled() {
+return logger.isInfoEnabled();
+}
+
+public boolean isTraceEnabled() {
+return logger.isTraceEnabled();
+}
+
+public boolean isWarnEnabled() {
+return logger.isWarnEnabled();
+}
+
+public void trace(String message) {
+logger.trace(message);
+}
+
+public void trace(String message, Throwable t) {
+logger.trace(message, t);
+}
+
+public void debug(String message) {
+logger.debug(message);
+}
+
+public void debug(String message, Throwable t) {
+logger.debug(message, t);
+}
+
+public void info(String message) {
+logger.info(message);
+}
+
+public void info(String message, Throwable t) {
+logger.info(message, t);
+}
+
+public void warn(String message) {
+logger.warn(message);
+}
+
+public void warn(String message, Throwable t) {
+logger.warn(message, t);
+}
+
+public void error(String message) {
+logger.error(message

svn commit: r1228622 - /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 14:33:42 2012
New Revision: 1228622

URL: http://svn.apache.org/viewvc?rev=1228622view=rev
Log:
The logger adapter was moved to james-server

Removed:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLoggerAdapter.java


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



svn commit: r1228630 - in /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx: CommandHandlerResultJMXMonitor.java SMTPCommandHandlerStats.java

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 15:06:08 2012
New Revision: 1228630

URL: http://svn.apache.org/viewvc?rev=1228630view=rev
Log:
Fix class-cast exception which was introduced by JAMES-1360

Modified:

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/CommandHandlerResultJMXMonitor.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/SMTPCommandHandlerStats.java

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/CommandHandlerResultJMXMonitor.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/CommandHandlerResultJMXMonitor.java?rev=1228630r1=1228629r2=1228630view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/CommandHandlerResultJMXMonitor.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/CommandHandlerResultJMXMonitor.java
 Sat Jan  7 15:06:08 2012
@@ -23,19 +23,18 @@ import java.util.Collection;
 import org.apache.james.protocols.api.handler.CommandHandler;
 import 
org.apache.james.protocols.lib.jmx.AbstractCommandHandlerResultJMXMonitor;
 import org.apache.james.protocols.lib.jmx.AbstractCommandHandlerStats;
-import org.apache.james.protocols.smtp.SMTPResponse;
 import org.apache.james.protocols.smtp.SMTPSession;
 
 /**
  * Expose JMX statistics for {@link 
org.apache.james.protocols.api.handler.CommandHandler}
  */
-public class CommandHandlerResultJMXMonitor extends 
AbstractCommandHandlerResultJMXMonitorSMTPResponse, SMTPSession {
+public class CommandHandlerResultJMXMonitor extends 
AbstractCommandHandlerResultJMXMonitorSMTPSession {
 
 /**
  * @see 
org.apache.james.protocols.lib.jmx.AbstractCommandHandlerResultJMXMonitor
  * 
#createCommandHandlerStats(org.apache.james.protocols.api.handler.CommandHandler)
  */
-protected AbstractCommandHandlerStatsSMTPResponse 
createCommandHandlerStats(CommandHandlerSMTPSession handler) throws Exception 
{
+protected AbstractCommandHandlerStats 
createCommandHandlerStats(CommandHandlerSMTPSession handler) throws Exception 
{
 CollectionString col = handler.getImplCommands();
 String cName = handler.getClass().getName();
 

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/SMTPCommandHandlerStats.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/SMTPCommandHandlerStats.java?rev=1228630r1=1228629r2=1228630view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/SMTPCommandHandlerStats.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/jmx/SMTPCommandHandlerStats.java
 Sat Jan  7 15:06:08 2012
@@ -26,14 +26,15 @@ import javax.management.MalformedObjectN
 import javax.management.NotCompliantMBeanException;
 
 import org.apache.james.lifecycle.api.Disposable;
+import org.apache.james.protocols.api.Response;
 import org.apache.james.protocols.api.handler.CommandHandler;
 import org.apache.james.protocols.lib.jmx.AbstractCommandHandlerStats;
-import org.apache.james.protocols.smtp.SMTPResponse;
+
 
 /**
  * Expose statistics for {@link CommandHandler} via JMX
  */
-public class SMTPCommandHandlerStats extends 
AbstractCommandHandlerStatsSMTPResponse implements 
SMTPCommandHandlerStatsMBean, Disposable {
+public class SMTPCommandHandlerStats extends AbstractCommandHandlerStats 
implements SMTPCommandHandlerStatsMBean, Disposable {
 
 private AtomicLong temp = new AtomicLong(0);
 private AtomicLong perm = new AtomicLong(0);
@@ -70,7 +71,7 @@ public class SMTPCommandHandlerStats ext
  * @see
  * 
org.apache.james.protocols.lib.jmx.AbstractCommandHandlerStats#incrementStats(org.apache.james.protocols.api.Response)
  */
-protected void incrementStats(SMTPResponse response) {
+protected void incrementStats(Response response) {
 try {
 String code = response.getRetCode();
 char c = code.charAt(0);



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



svn commit: r1228639 - in /james/server/trunk/smtpserver: ./ src/main/java/org/apache/james/smtpserver/ src/main/java/org/apache/james/smtpserver/fastfail/ src/test/java/org/apache/james/smtpserver/

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 15:51:03 2012
New Revision: 1228639

URL: http://svn.apache.org/viewvc?rev=1228639view=rev
Log:
Fix some more bugs which were introduced by JAMES-1360

Modified:
james/server/trunk/smtpserver/pom.xml

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/POP3BeforeSMTPHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ResolvableEhloHeloHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ReverseEqualsEhloHeloHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SPFHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SpamAssassinHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ValidSenderDomainHandler.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/POP3BeforeSMTPHandlerTest.java

Modified: james/server/trunk/smtpserver/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/pom.xml?rev=1228639r1=1228638r2=1228639view=diff
==
--- james/server/trunk/smtpserver/pom.xml (original)
+++ james/server/trunk/smtpserver/pom.xml Sat Jan  7 15:51:03 2012
@@ -203,6 +203,11 @@
 artifactIdslf4j-nop/artifactId
 scopetest/scope
 /dependency
+dependency
+groupIdcommons-codec/groupId
+artifactIdcommons-codec/artifactId
+scopetest/scope
+/dependency
 /dependencies
 
 build

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java?rev=1228639r1=1228638r2=1228639view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/AddDefaultAttributesMessageHook.java
 Sat Jan  7 15:51:03 2012
@@ -44,7 +44,7 @@ public class AddDefaultAttributesMessage
 
 final MailImpl mailImpl = (MailImpl) mail;
 mailImpl.setRemoteHost(session.getRemoteAddress().getHostName());
-
mailImpl.setRemoteAddr(session.getRemoteAddress().getAddress().toString());
+
mailImpl.setRemoteAddr(session.getRemoteAddress().getAddress().getHostAddress());
 if (session.getUser() != null) {
 mail.setAttribute(SMTP_AUTH_USER_ATTRIBUTE_NAME, 
session.getUser());
 }

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/POP3BeforeSMTPHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/POP3BeforeSMTPHandler.java?rev=1228639r1=1228638r2=1228639view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/POP3BeforeSMTPHandler.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/POP3BeforeSMTPHandler.java
 Sat Jan  7 15:51:03 2012
@@ -70,7 +70,7 @@ public class POP3BeforeSMTPHandler imple
 }
 
 // Check if the ip is allowed to relay
-if (!session.isRelayingAllowed()  
POP3BeforeSMTPHelper.isAuthorized(session.getRemoteAddress().getAddress().toString()))
 {
+if (!session.isRelayingAllowed()  
POP3BeforeSMTPHelper.isAuthorized(session.getRemoteAddress().getAddress().getHostAddress()))
 {
 session.setRelayingAllowed(true);
 }
 return null;

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java?rev=1228639r1=1228638r2=1228639view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java
 Sat Jan  7 15:51:03 2012
@@ -19,16 +19,28 @@
 
 package org.apache.james.smtpserver.fastfail;
 
+import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
+import

svn commit: r1228642 - /james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 16:07:01 2012
New Revision: 1228642

URL: http://svn.apache.org/viewvc?rev=1228642view=rev
Log:
Correctly convert MailAddress for recipients

Modified:

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java?rev=1228642r1=1228641r2=1228642view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
 Sat Jan  7 16:07:01 2012
@@ -88,9 +88,14 @@ public class DataLineJamesMessageHookHan
 out.flush();
 out.close();
 
-List recipientCollection = (List) 
session.getState().get(SMTPSession.RCPT_LIST);
+ListMailAddress recipientCollection = (ListMailAddress) 
session.getState().get(SMTPSession.RCPT_LIST);
 MailAddress mailAddress = (MailAddress) 
session.getState().get(SMTPSession.SENDER);
-MailImpl mail = new MailImpl(MailImpl.getId(), new 
MailetMailAddressAdapter(mailAddress), recipientCollection);
+
+Listorg.apache.mailet.MailAddress rcpts = new 
ArrayListorg.apache.mailet.MailAddress();
+for (MailAddress address: recipientCollection) {
+rcpts.add(new MailetMailAddressAdapter(address));
+}
+MailImpl mail = new MailImpl(MailImpl.getId(), new 
MailetMailAddressAdapter(mailAddress), rcpts);
 
 // store mail in the session so we can be sure it get disposed
 // later



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



svn commit: r1228699 - in /james/server/trunk/smtpserver/src: main/java/org/apache/james/smtpserver/ main/java/org/apache/james/smtpserver/fastfail/ main/java/org/apache/james/smtpserver/netty/ test/j

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 19:09:05 2012
New Revision: 1228699

URL: http://svn.apache.org/viewvc?rev=1228699view=rev
Log:
Fix deprecated usage of procotols api.

Modified:

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/JamesDataCmdHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SPFHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/SpamAssassinHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/URIRBLHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptMX.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SPFHandlerTest.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/SpamAssassinHandlerTest.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/URIRBLHandlerTest.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/ValidRcptMXTest.java

Modified: 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java?rev=1228699r1=1228698r2=1228699view=diff
==
--- 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
 (original)
+++ 
james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
 Sat Jan  7 19:09:05 2012
@@ -36,6 +36,7 @@ import org.apache.james.core.MimeMessage
 import org.apache.james.core.MimeMessageInputStream;
 import org.apache.james.core.MimeMessageInputStreamSource;
 import org.apache.james.lifecycle.api.LifecycleUtil;
+import org.apache.james.protocols.api.ProtocolSession.State;
 import org.apache.james.protocols.api.Response;
 import org.apache.james.protocols.api.handler.ExtensibleHandler;
 import org.apache.james.protocols.api.handler.LineHandler;
@@ -77,7 +78,7 @@ public class DataLineJamesMessageHookHan
 byte[] line = new byte[lineByteBuffer.remaining()];
 lineByteBuffer.get(line, 0, line.length);
 
-MimeMessageInputStreamSource mmiss = (MimeMessageInputStreamSource) 
session.getState().get(SMTPConstants.DATA_MIMEMESSAGE_STREAMSOURCE);
+MimeMessageInputStreamSource mmiss = (MimeMessageInputStreamSource) 
session.getAttachment(SMTPConstants.DATA_MIMEMESSAGE_STREAMSOURCE, 
State.Transaction);
 
 try {
 OutputStream out = mmiss.getWritableOutputStream();
@@ -88,8 +89,8 @@ public class DataLineJamesMessageHookHan
 out.flush();
 out.close();
 
-ListMailAddress recipientCollection = (ListMailAddress) 
session.getState().get(SMTPSession.RCPT_LIST);
-MailAddress mailAddress = (MailAddress) 
session.getState().get(SMTPSession.SENDER);
+ListMailAddress recipientCollection = (ListMailAddress) 
session.getAttachment(SMTPSession.RCPT_LIST, State.Transaction);
+MailAddress mailAddress = (MailAddress) 
session.getAttachment(SMTPSession.SENDER, State.Transaction);
 
 Listorg.apache.mailet.MailAddress rcpts = new 
ArrayListorg.apache.mailet.MailAddress();
 for (MailAddress address: recipientCollection) {
@@ -99,7 +100,7 @@ public class DataLineJamesMessageHookHan
 
 // store mail in the session so we can be sure it get disposed
 // later
-session.getState().put(SMTPConstants.MAIL, mail);
+session.setAttachment(SMTPConstants.MAIL, mail, 
State.Transaction);
 
 MimeMessageCopyOnWriteProxy mimeMessageCopyOnWriteProxy = null;
 try {
@@ -151,7 +152,7 @@ public class DataLineJamesMessageHookHan
 protected Response processExtensions(SMTPSession session, Mail mail) {
 if (mail != null  messageHandlers != null) {
 try {
-MimeMessageInputStreamSource mmiss = 
(MimeMessageInputStreamSource) 
session.getState().get(SMTPConstants.DATA_MIMEMESSAGE_STREAMSOURCE);
+MimeMessageInputStreamSource mmiss = 
(MimeMessageInputStreamSource) 
session.getAttachment(SMTPConstants.DATA_MIMEMESSAGE_STREAMSOURCE, 
State.Transaction);
 OutputStream out = null;
 try {
 out

svn commit: r1228734 - in /james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core: AbstractHookableCmdHandler.java esmtp/AuthCmdHandler.java esmtp/EhloCmdHandler.java

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 21:56:02 2012
New Revision: 1228734

URL: http://svn.apache.org/viewvc?rev=1228734view=rev
Log:
Some cleanup

Modified:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java?rev=1228734r1=1228733r2=1228734view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
 Sat Jan  7 21:56:02 2012
@@ -256,12 +256,12 @@ public abstract class AbstractHookableCm
  * @see 
org.apache.james.protocols.api.handler.ExtensibleHandler#wireExtensions(java.lang.Class,
  *  java.util.List)
  */
-@SuppressWarnings({ unchecked, rawtypes })
-public void wireExtensions(Class interfaceName, List extension) {
+@SuppressWarnings(unchecked)
+   public void wireExtensions(Class? interfaceName, List? extension) {
 if (getHookInterface().equals(interfaceName)) {
-this.hooks = extension;
+this.hooks = (ListHook) extension;
 } else if (HookResultHook.class.equals(interfaceName)) {
-this.rHooks = extension;
+this.rHooks = (ListHookResultHook) extension;
 }
 
 }

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java?rev=1228734r1=1228733r2=1228734view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
 Sat Jan  7 21:56:02 2012
@@ -496,16 +496,16 @@ public class AuthCmdHandler
 /**
  * @see 
org.apache.james.protocols.api.handler.ExtensibleHandler#wireExtensions(java.lang.Class,
 java.util.List)
  */
-@SuppressWarnings({ unchecked, rawtypes })
-public void wireExtensions(Class interfaceName, List extension) throws 
WiringException {
+@SuppressWarnings(unchecked)
+   public void wireExtensions(Class? interfaceName, List? extension) 
throws WiringException {
 if (AuthHook.class.equals(interfaceName)) {
-this.hooks = extension;
+this.hooks = (ListAuthHook) extension;
 // If no AuthHook is configured then we revert to the default 
LocalUsersRespository check
 if (hooks == null || hooks.size() == 0) {
 throw new WiringException(AuthCmdHandler used without 
AuthHooks);
 }
 } else if (HookResultHook.class.equals(interfaceName)) {
-this.rHooks = extension;
+this.rHooks = (ListHookResultHook) extension;
 }
 }
 

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java?rev=1228734r1=1228733r2=1228734view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/EhloCmdHandler.java
 Sat Jan  7 21:56:02 2012
@@ -96,11 +96,11 @@ public class EhloCmdHandler extends Abst
  * @see 
org.apache.james.protocols.api.handler.ExtensibleHandler#wireExtensions(java.lang.Class,
  *  java.util.List)
  */
-@SuppressWarnings({ unchecked, rawtypes })
-public void wireExtensions(Class interfaceName, List extension) {
+@SuppressWarnings(unchecked)
+   public void wireExtensions(Class? interfaceName, List? extension) {
 super.wireExtensions(interfaceName, extension);
 if (EhloExtension.class.equals(interfaceName)) {
-this.ehloExtensions = extension;
+this.ehloExtensions = (ListEhloExtension) extension;
 }
 }
 



-
To unsubscribe, e-mail: server-dev

svn commit: r1228736 - in /james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core: CapaCapability.java CapaCmdHandler.java StlsCmdHandler.java TopCmdHandler.java UidlCmdHandler.

2012-01-07 Thread norman
Author: norman
Date: Sat Jan  7 22:08:17 2012
New Revision: 1228736

URL: http://svn.apache.org/viewvc?rev=1228736view=rev
Log:
Use Set as return type of CapaCapability's method. See PROTOCOLS-84

Modified:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/UserCmdHandler.java

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java?rev=1228736r1=1228735r2=1228736view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java
 Sat Jan  7 22:08:17 2012
@@ -19,7 +19,7 @@
 
 package org.apache.james.protocols.pop3.core;
 
-import java.util.List;
+import java.util.Set;
 
 import org.apache.james.protocols.pop3.POP3Session;
 
@@ -37,5 +37,5 @@ public interface CapaCapability {
  * @param session
  * @return list
  */
-ListString getImplementedCapabilities(POP3Session session);
+SetString getImplementedCapabilities(POP3Session session);
 }

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java?rev=1228736r1=1228735r2=1228736view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
 Sat Jan  7 22:08:17 2012
@@ -23,7 +23,9 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 
 import org.apache.james.protocols.api.Request;
@@ -40,7 +42,7 @@ import org.apache.james.protocols.pop3.P
 public class CapaCmdHandler implements CommandHandlerPOP3Session, 
ExtensibleHandler, CapaCapability {
 private ListCapaCapability caps;
 private static final CollectionString COMMANDS = 
Collections.unmodifiableCollection(Arrays.asList(CAPA));
-private static final ListString CAPS = 
Collections.unmodifiableList(Arrays.asList(PIPELINING));
+private static final SetString CAPS = Collections.unmodifiableSet(new 
HashSetString(Arrays.asList(PIPELINING)));
 
 /**
  * @see
@@ -51,9 +53,8 @@ public class CapaCmdHandler implements C
 POP3Response response = new POP3Response(POP3Response.OK_RESPONSE, 
Capability list follows);
 
 for (int i = 0; i  caps.size(); i++) {
-ListString cList = 
caps.get(i).getImplementedCapabilities(session);
-for (int a = 0; a  cList.size(); a++) {
-response.appendLine(cList.get(a));
+for (String cap: caps.get(i).getImplementedCapabilities(session)) {
+response.appendLine(cap);
 }
 }
 response.appendLine(.);
@@ -74,10 +75,10 @@ public class CapaCmdHandler implements C
  * @see 
org.apache.james.protocols.api.handler.ExtensibleHandler#wireExtensions(java.lang.Class,
  *  java.util.List)
  */
-@SuppressWarnings({ unchecked, rawtypes })
-public void wireExtensions(Class interfaceName, List extension) throws 
WiringException {
+@SuppressWarnings(unchecked)
+   public void wireExtensions(Class? interfaceName, List? extension) 
throws WiringException {
 if (interfaceName.equals(CapaCapability.class)) {
-caps = extension;
+caps = (ListCapaCapability) extension;
 }
 }
 
@@ -91,7 +92,7 @@ public class CapaCmdHandler implements C
 /**
  * @see 
org.apache.james.pop3server.core.CapaCapability#getImplementedCapabilities(org.apache.james.pop3server.POP3Session)
  */
-public ListString getImplementedCapabilities(POP3Session session) {
+public SetString getImplementedCapabilities(POP3Session session) {
 return CAPS;
 }
 

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
URL: 
http

[jira] [Created] (PROTOCOLS-84) CapaCapability.getImplementedCapabilities(..) should return a Set

2012-01-07 Thread Norman Maurer (Created) (JIRA)
CapaCapability.getImplementedCapabilities(..) should return a Set
-

 Key: PROTOCOLS-84
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-84
 Project: JAMES Protocols
  Issue Type: Task
  Components: pop3
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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] (PROTOCOLS-84) CapaCapability.getImplementedCapabilities(..) should return a Set

2012-01-07 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-84.


Resolution: Fixed

done

 CapaCapability.getImplementedCapabilities(..) should return a Set
 -

 Key: PROTOCOLS-84
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-84
 Project: JAMES Protocols
  Issue Type: Task
  Components: pop3
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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: ACL Support - cont. from server-user

2012-01-06 Thread Norman Maurer
Hi Jochen,
comments inside..



Am Freitag, 6. Januar 2012 um 12:25 schrieb Jochen Gazda:

 Gentlemen,
  
 Please read and comment.
  
 I have started to implement the ACL support. In the very first phase I
 would like to
 - add support for IMAP GETACL command and
 - add support for storing ACL at least for one storage backend.
  
 During this first phase I would like to learn how to do things in a
 James-compiliant way so that I will be able to implement other ACL
 commands later.
  
 1. A new interface org.apache.james.mailbox.MailboxACL and default
 implementation org.apache.james.mailbox.store.SimpleMailboxACL
 Stores an ACL applicable to a mailbox. Inspired by RFC4314 IMAP4
 Access Control List (ACL) Extension.
 Note: An ACL class that could serve our purpose exists in
 com.sun.mail.imap. We will not stick to a proprietary API, will we?
  
  

Nope we should not use it here. I would even be in favor to remove the usage of 
javamail at all in mailbox but thats another story..

  
  
 2. MailboxACL usage:
 org.apache.james.mailbox.store.mail.model.MailboxId and
 implementations will be extended to store the related ACL:
 MailboxACL getACL();
 void setACL(MailboxACL acl);
 This is probably OK.
  
  

Yes
  
  
 3. MailboxACL usage: org.apache.james.mailbox.MessageManager.MetaData
 will be extended to offer a read access to the ACL of the related
 mailbox. This was approved by Norman Maurer.
 MailboxACL getACL();
  
 4. MailboxACL usage: Under org.apache.james.imap ACL-related requests,
 decoders, responses, encoders and processors will use MailboxACL.
 It is probably OK as there is a lot of org.apache.james.mailbox.*
 usage under org.apache.james.imap.
  
  

yeah...
  
  
 5. MailboxACL instantiation: Clearly, there will be (at least) two
 places where MailboxACL will be instantiated:
 i. In Mailbox implementations when reading ACLs from their backends
 ii. In org.apache.james.imap decoders when parsing the ACL related
 IMAP requests.
  
 At the moment I have hardcoded a constructor of my default
 implementation on both places. I am asking myself if some kind of
 factory pattern should be used instead.
  
  

Just use the constructor for now, we can change later if needed...
  
  
 6. How to access an ACL stored in a mailbox backend from a subclass of
 org.apache.james.imap.processor.AbstractMailboxProcessor:
 At the moment I have this code to prepare a response for GETACL IMAP command:
 MessageManager messageManager =
 getMailboxManager().getMailbox(buildFullPath(session, mailboxName),
 mailboxSession);
 MetaData metaData = messageManager.getMetaData(false,
 mailboxSession, FetchGroup.NO_COUNT);
  
 I have not tested it yet, but principally, it should work. I only
 wonder at two things with that code:
  
 i. org.apache.james.mailbox.MailboxManager.getMailbox(MailboxPath,
 MailboxSession)
 It returns a MessageManager rather than a Mailbox. Should it not
 rather be called getMessageManager?
  
  

Yeah it should. Its called getMailbox(..) for historic reasons.. I guess we 
should change it like you suggested..

  
  
 ii. org.apache.james.mailbox.MessageManager.getMetaData(boolean,
 MailboxSession, FetchGroup)
 Javadoc says Gets current meta data for the mailbox. Why is
 this method in MessageManager and not in MailboxManager?
  
  


As the info you need to retrieve is depend to the MessageManager you got. Like 
getting the message count, unseen messages etc..
  
  
 7. What and in which order should the GetACLProcessor say after
 sending the ACL response?
 i. Should it send also unsolicitedResponses?
 ii. unsolicitedResponses should be sent before or after okComplete?
 iii. on MailboxException, we send no() and I wonder what should its
 HumanReadableText say?
 iv. is the no() sufficient for all exceptions? What if somebody is
 asking for ACL of a folder which
 (a) does not exist or
 (b) cannot be looked up by the current user?
 Isn't taggedBad more suitable for (a) and/or (b)?
  
I will need to review the RFC for this to answer..
  
  
 Here is what I have now:
  
 @Override
 protected void doProcess(GetACLRequest message, ImapSession
 session, String tag, ImapCommand command, Responder responder) {
 final MailboxManager mailboxManager = getMailboxManager();
 final MailboxSession mailboxSession =
 ImapSessionUtils.getMailboxSession(session);
 try {
 String mailboxName = message.getMailboxName();
 MessageManager messageManager =
 mailboxManager.getMailbox(buildFullPath(session, mailboxName),
 mailboxSession);
 MetaData metaData = messageManager.getMetaData(false,
 mailboxSession, FetchGroup.NO_COUNT);
 ACLResponse aclResponse = new ACLResponse(mailboxName,
 metaData.getACL());
 responder.respond(aclResponse);
 okComplete(command, tag, responder);
 //FIXME should we send unsolicited responses here?
 //unsolicitedResponses(session, responder, false);
 } catch (MailboxException e) {
 // FIXME: be more specific in the human readable text.
 no(command, tag, responder

Re: ACL Support - cont. from server-user

2012-01-06 Thread Norman Maurer
You should use the MailboxPath for resolve the ACLs.

Where you need to inject the resolver depends on the needs. But I guess you 
need it in both..

Bye
Norman

Sent from my iPhone. Excuse any typos

Am 06.01.2012 um 14:18 schrieb Jochen Gazda gazdahims...@gmail.com:

 Norman,
 
 8. Interpretation of ACLs:
 To have ACL stored on every mailbox is far from being able to tell if
 the given user can perform the given operation for the given
 mailbox(es when copying/moving).
 A new service responsible for resolving of ACLs is necessary. I
 propose to call it MailboxACLResolver.
 In which package should it be placed? Also in org.apache.james.mailbox?
 Probably every single operation between IMAP and mailbox stores should
 pass through this service. Where in the code should such a permission
 enforcement be placed?
 How should MailboxACLResolver be instantiated?
 
 Yeah mailbox api I think… It should be instanced once and get injected in 
 the constructor.
 
 Hmmm... I thought that MailboxACLResolver would offer a method like
 the following:
 
  boolean hasRight(User user, Mailbox mailbox, Right right);
 
 But org.apache.james.mailbox.store.mail.model.Mailbox is not visible
 in in mailbox-store. Should I place MailboxACLResolver to
 mailbox-store? Or I should rely on
 org.apache.james.mailbox.MailboxPath rather than Mailbox itself?
 
 [MailboxACLResolver] should be instanced once and get injected in the 
 constructor.
 
 Which constructor? MessageManager or MailBoxManager or both?
 
 Best,
 
 Gazda
 
 -
 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: ACL Support - cont. from server-user

2012-01-06 Thread Norman Maurer
@Eric:

I think Jochen should just code in the imap trunk for now.. We will merge it 
later then. As the code in protocols need many more work :/

Bye,
Norman


-- 
Norman Maurer


Am Freitag, 6. Januar 2012 um 18:34 schrieb Eric Charles:

 As a side note, we are moving IMAP code from
 
 https://svn.apache.org/repos/asf/james/imap/trunk/
 to
 https://svn.apache.org/repos/asf/james/protocols/trunk/imap/
 
 I would be better that you code in the latter.
 
 Thx,
 Eric
 
 
 On 06/01/12 12:25, Jochen Gazda wrote:
  Gentlemen,
  
  Please read and comment.
  
  I have started to implement the ACL support. In the very first phase I
  would like to
  - add support for IMAP GETACL command and
  - add support for storing ACL at least for one storage backend.
  
  During this first phase I would like to learn how to do things in a
  James-compiliant way so that I will be able to implement other ACL
  commands later.
  
  1. A new interface org.apache.james.mailbox.MailboxACL and default
  implementation org.apache.james.mailbox.store.SimpleMailboxACL
  Stores an ACL applicable to a mailbox. Inspired by RFC4314 IMAP4
  Access Control List (ACL) Extension.
  Note: An ACL class that could serve our purpose exists in
  com.sun.mail.imap. We will not stick to a proprietary API, will we?
  
  2. MailboxACL usage:
  org.apache.james.mailbox.store.mail.model.MailboxId and
  implementations will be extended to store the related ACL:
  MailboxACL getACL();
  void setACL(MailboxACL acl);
  This is probably OK.
  
  3. MailboxACL usage: org.apache.james.mailbox.MessageManager.MetaData
  will be extended to offer a read access to the ACL of the related
  mailbox. This was approved by Norman Maurer.
  MailboxACL getACL();
  
  4. MailboxACL usage: Under org.apache.james.imap ACL-related requests,
  decoders, responses, encoders and processors will use MailboxACL.
  It is probably OK as there is a lot of org.apache.james.mailbox.*
  usage under org.apache.james.imap.
  
  5. MailboxACL instantiation: Clearly, there will be (at least) two
  places where MailboxACL will be instantiated:
  i. In Mailbox implementations when reading ACLs from their backends
  ii. In org.apache.james.imap decoders when parsing the ACL related
  IMAP requests.
  
  At the moment I have hardcoded a constructor of my default
  implementation on both places. I am asking myself if some kind of
  factory pattern should be used instead.
  
  6. How to access an ACL stored in a mailbox backend from a subclass of
  org.apache.james.imap.processor.AbstractMailboxProcessor:
  At the moment I have this code to prepare a response for GETACL IMAP 
  command:
  MessageManager messageManager =
  getMailboxManager().getMailbox(buildFullPath(session, mailboxName),
  mailboxSession);
  MetaData metaData = messageManager.getMetaData(false,
  mailboxSession, FetchGroup.NO_COUNT);
  
  I have not tested it yet, but principally, it should work. I only
  wonder at two things with that code:
  
  i. org.apache.james.mailbox.MailboxManager.getMailbox(MailboxPath,
  MailboxSession)
  It returns a MessageManager rather than a Mailbox. Should it not
  rather be called getMessageManager?
  
  ii. org.apache.james.mailbox.MessageManager.getMetaData(boolean,
  MailboxSession, FetchGroup)
  Javadoc says Gets current meta data for the mailbox. Why is
  this method in MessageManager and not in MailboxManager?
  
  7. What and in which order should the GetACLProcessor say after
  sending the ACL response?
  i. Should it send also unsolicitedResponses?
  ii. unsolicitedResponses should be sent before or after okComplete?
  iii. on MailboxException, we send no() and I wonder what should its
  HumanReadableText say?
  iv. is the no() sufficient for all exceptions? What if somebody is
  asking for ACL of a folder which
  (a) does not exist or
  (b) cannot be looked up by the current user?
  Isn't taggedBad more suitable for (a) and/or (b)?
  
  Here is what I have now:
  
  @Override
  protected void doProcess(GetACLRequest message, ImapSession
  session, String tag, ImapCommand command, Responder responder) {
  final MailboxManager mailboxManager = getMailboxManager();
  final MailboxSession mailboxSession =
  ImapSessionUtils.getMailboxSession(session);
  try {
  String mailboxName = message.getMailboxName();
  MessageManager messageManager =
  mailboxManager.getMailbox(buildFullPath(session, mailboxName),
  mailboxSession);
  MetaData metaData = messageManager.getMetaData(false,
  mailboxSession, FetchGroup.NO_COUNT);
  ACLResponse aclResponse = new ACLResponse(mailboxName,
  metaData.getACL());
  responder.respond(aclResponse);
  okComplete(command, tag, responder);
  //FIXME should we send unsolicited responses here?
  //unsolicitedResponses(session, responder, false);
  } catch (MailboxException e) {
  // FIXME: be more specific in the human readable text.
  no(command, tag, responder,
  HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING);
  }
  }
  
  
  8. Interpretation of ACLs

svn commit: r1228296 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTran

2012-01-06 Thread norman
Author: norman
Date: Fri Jan  6 17:37:05 2012
New Revision: 1228296

URL: http://svn.apache.org/viewvc?rev=1228296view=rev
Log:
Add optimization for zero-copy when possible

Modified:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java

james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java?rev=1228296r1=1228295r2=1228296view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
 Fri Jan  6 17:37:05 2012
@@ -222,10 +222,6 @@ public class CommandDispatcherSession e
 }
 curCommandName = curCommandName.toUpperCase(Locale.US);
 
-if (session.getLogger().isDebugEnabled()) {
-session.getLogger().debug(getClass().getName() +  received:  + 
cmdString);
-}
-
 BaseRequest request = new BaseRequest(curCommandName, 
curCommandArgument);
 return request;
 

Modified: 
james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java?rev=1228296r1=1228295r2=1228296view=diff
==
--- 
james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java
 (original)
+++ 
james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/NettyProtocolTransport.java
 Fri Jan  6 17:37:05 2012
@@ -19,17 +19,23 @@
 
 package org.apache.james.protocols.netty;
 
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
+import java.nio.channels.FileChannel;
+import java.util.Iterator;
 
 import javax.net.ssl.SSLEngine;
 
 import org.apache.james.protocols.api.AbstractProtocolTransport;
+import org.apache.james.protocols.api.CombinedInputStream;
 import org.apache.james.protocols.api.ProtocolSession;
 import org.apache.james.protocols.api.handler.LineHandler;
 import org.jboss.netty.buffer.ChannelBuffers;
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelFutureListener;
+import org.jboss.netty.channel.DefaultFileRegion;
 import org.jboss.netty.handler.ssl.SslHandler;
 import org.jboss.netty.handler.stream.ChunkedStream;
 
@@ -135,6 +141,39 @@ public class NettyProtocolTransport exte
 if (startTLS) {
 prepareStartTLS();
 }
+if (!isTLSStarted()) {
+if (in instanceof FileInputStream) {
+FileChannel fChannel = ((FileInputStream) in).getChannel();
+try {
+channel.write(new DefaultFileRegion(fChannel, 0, 
fChannel.size(), true));
+
+} catch (IOException e) {
+// We handle this later
+channel.write(new ChunkedStream(in));
+}
+return;
+
+} else if (in instanceof CombinedInputStream) {
+IteratorInputStream streams = ((CombinedInputStream) 
in).iterator();
+while(streams.hasNext()) {
+InputStream pIn = streams.next();
+if (pIn instanceof FileInputStream) {
+FileChannel fChannel = ((FileInputStream) 
in).getChannel();
+try {
+channel.write(new DefaultFileRegion(fChannel, 0, 
fChannel.size(), true));
+return;
+
+} catch (IOException e) {
+// We handle this later
+channel.write(new ChunkedStream(in));
+}
+} else {
+channel.write(new ChunkedStream(in));
+}
+}
+return;
+}
+} 
 channel.write(new ChunkedStream(in));
 }
 



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



svn commit: r1228297 - /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java

2012-01-06 Thread norman
Author: norman
Date: Fri Jan  6 17:40:38 2012
New Revision: 1228297

URL: http://svn.apache.org/viewvc?rev=1228297view=rev
Log:
Use zero-copy if possible

Added:

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

Added: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java?rev=1228297view=auto
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
 (added)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
 Fri Jan  6 17:40:38 2012
@@ -0,0 +1,80 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.protocols.api;
+
+import java.io.InputStream;
+import java.io.SequenceInputStream;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * {@link SequenceInputStream} sub-class which allows direct access to the 
pair of {@link InputStream}'s.
+ * 
+ * When ever you need to combine two {@link InputStream}'s you should use 
this class as it may allow the Transport to optimize the transfer of it!
+ * 
+ *
+ */
+public class CombinedInputStream extends SequenceInputStream implements 
IterableInputStream{
+
+private final InputStream[] streams;
+
+public CombinedInputStream(InputStream s1, InputStream s2) {
+super(s1, s2);
+streams = new InputStream[] {s1, s2};
+}
+
+/*
+ * (non-Javadoc)
+ * @see java.lang.Iterable#iterator()
+ */
+public IteratorInputStream iterator() {
+return new IteratorInputStream() {
+private int count = 0;
+   
+/*
+ * (non-Javadoc)
+ * @see java.util.Iterator#hasNext()
+ */
+public boolean hasNext() {
+return count  streams.length;
+}
+
+/*
+ * (non-Javadoc)
+ * @see java.util.Iterator#next()
+ */
+public InputStream next() {
+if (hasNext())  {
+return streams[count++];
+} else {
+throw new NoSuchElementException();
+}
+}
+
+/**
+ * Read-Only
+ */
+public void remove() {
+throw new UnsupportedOperationException(Read-Only);
+}
+};
+}
+
+}



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



svn commit: r1228298 - /james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java

2012-01-06 Thread norman
Author: norman
Date: Fri Jan  6 17:41:22 2012
New Revision: 1228298

URL: http://svn.apache.org/viewvc?rev=1228298view=rev
Log:
Fix writing back POP3Response with null argument to client

Modified:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java?rev=1228298r1=1228297r2=1228298view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
 Fri Jan  6 17:41:22 2012
@@ -71,7 +71,7 @@ public class POP3Response extends Abstra
  * 
  */
 public POP3Response(String code) {
-this(code, null);
+setRetCode(code);
 }
 
 protected POP3Response() {
@@ -85,11 +85,15 @@ public class POP3Response extends Abstra
  */
 public ListCharSequence getLines() {
 ListCharSequence responseList = new ArrayListCharSequence();
-for (int i = 0; i  lines.size(); i++) {
-if (i == 0) {
-responseList.add(getRetCode() + WS +lines.get(i));
-} else {
-responseList.add(lines.get(i));
+if (lines.isEmpty()) {
+responseList.add(getRetCode());
+} else {
+for (int i = 0; i  lines.size(); i++) {
+if (i == 0) {
+responseList.add(getRetCode() + WS +lines.get(i));
+} else {
+responseList.add(lines.get(i));
+}
 }
 }
 return responseList;



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



svn commit: r1228299 - in /james/protocols/trunk/pop3/src: main/java/org/apache/james/protocols/pop3/core/ test/java/org/apache/james/protocols/pop3/

2012-01-06 Thread norman
Author: norman
Date: Fri Jan  6 17:42:12 2012
New Revision: 1228299

URL: http://svn.apache.org/viewvc?rev=1228299view=rev
Log:
Make sure we correctly handle non existing message numbers. Also adding more 
test cases for this.

Added:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
Modified:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/RetrCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java?rev=1228299r1=1228298r2=1228299view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/DeleCmdHandler.java
 Fri Jan  6 17:42:12 2012
@@ -55,10 +55,14 @@ public class DeleCmdHandler implements C
 return SYNTAX_ERROR;
 }
 try {
-ListMessageMetaData uidList = (ListMessageMetaData) 
session.getAttachment(POP3Session.UID_LIST, State.Transaction);
+MessageMetaData meta = 
MessageMetaDataUtils.getMetaData(session, num);
+if (meta == null) {
+StringBuilder responseBuffer = new 
StringBuilder(64).append(Message ().append(num).append() does not exist.);
+return  new POP3Response(POP3Response.ERR_RESPONSE, 
responseBuffer.toString());
+}
 ListLong deletedUidList = (ListLong) 
session.getAttachment(POP3Session.DELETED_UID_LIST, State.Transaction);
 
-Long uid = uidList.get(num - 1).getUid();
+Long uid = meta.getUid();
 
 if (deletedUidList.contains(uid)) {
 StringBuilder responseBuffer = new 
StringBuilder(64).append(Message ().append(num).append() already deleted.);

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java?rev=1228299r1=1228298r2=1228299view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
 Fri Jan  6 17:42:12 2012
@@ -87,7 +87,13 @@ public class ListCmdHandler implements C
 int num = 0;
 try {
 num = Integer.parseInt(parameters);
-MessageMetaData data = uidList.get(num - 1);
+
+MessageMetaData data = 
MessageMetaDataUtils.getMetaData(session, num);
+if (data == null) {
+StringBuilder responseBuffer = new 
StringBuilder(64).append(Message ().append(num).append() does not exist.);
+return  new POP3Response(POP3Response.ERR_RESPONSE, 
responseBuffer.toString());
+}
+
 if (deletedUidList.contains(data.getUid()) == false) {
 
 StringBuilder responseBuffer = new 
StringBuilder(64).append(num).append( ).append(data.getSize());

Added: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java?rev=1228299view=auto
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
 (added)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
 Fri Jan  6 17:42:12 2012
@@ -0,0 +1,47 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional

[jira] [Created] (PROTOCOLS-79) Remove DNSService interface

2012-01-01 Thread Norman Maurer (Created) (JIRA)
Remove DNSService interface
---

 Key: PROTOCOLS-79
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-79
 Project: JAMES Protocols
  Issue Type: Task
  Components: smtp
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


We should remove the DNSService interface in the smtp module. Its not needed 
for almost all handlers. For these that really need it we should move to 
abstract classes.

--
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: r1226220 - in /james/protocols/trunk/smtp/src: main/java/org/apache/james/protocols/smtp/ main/java/org/apache/james/protocols/smtp/core/fastfail/ test/java/org/apache/james/protocols/smtp

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 09:16:19 2012
New Revision: 1226220

URL: http://svn.apache.org/viewvc?rev=1226220view=rev
Log:
Remove DNSService interface. See PROTOCOLS-79

Removed:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/DNSService.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeDNSService.java
Modified:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ResolvableEhloHeloHandler.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ReverseEqualsEhloHeloHandler.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ValidSenderDomainHandler.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandlerTest.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/ResolvableEhloHeloHandlerTest.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/ValidSenderDomainHandlerTest.java

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java?rev=1226220r1=1226219r2=1226220view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
 Sun Jan  1 09:16:19 2012
@@ -21,11 +21,13 @@
 
 package org.apache.james.protocols.smtp.core.fastfail;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.StringTokenizer;
 
 import org.apache.james.protocols.api.ProtocolSession.State;
-import org.apache.james.protocols.smtp.DNSService;
 import org.apache.james.protocols.smtp.MailAddress;
 import org.apache.james.protocols.smtp.SMTPSession;
 import org.apache.james.protocols.smtp.dsn.DSNStatus;
@@ -44,9 +46,7 @@ public class DNSRBLHandler implements  R
  */
 private String[] whitelist;
 private String[] blacklist;
-
-private DNSService dnsService = null;
-
+
 private boolean getDetail = false;
 
 private String blocklistedDetail = null;
@@ -54,16 +54,6 @@ public class DNSRBLHandler implements  R
 public static final String RBL_BLOCKLISTED_MAIL_ATTRIBUTE_NAME = 
org.apache.james.smtpserver.rbl.blocklisted;
 
 public static final String RBL_DETAIL_MAIL_ATTRIBUTE_NAME = 
org.apache.james.smtpserver.rbl.detail;
-
-
-/**
- * Sets the DNS service.
- * @param dnsService the dnsService to set
- */
-public final void setDNSService(DNSService dnsService) {
-this.dnsService = dnsService;
-}
-

 
 /**
@@ -137,52 +127,84 @@ public class DNSRBLHandler implements  R
 
 if (whitelist != null) {
 String[] rblList = whitelist;
-for (int i = 0 ; i  rblList.length ; i++) try {
-dnsService.getByName(reversedOctets + rblList[i]);
-if (session.getLogger().isInfoEnabled()) {
-session.getLogger().info(Connection from  + 
ipAddress +  whitelisted by  + rblList[i]);
-}
+for (int i = 0 ; i  rblList.length ; i++) {
+if (resolve(reversedOctets + rblList[i])) {
+if (session.getLogger().isInfoEnabled()) {
+session.getLogger().info(Connection from  + 
ipAddress +  whitelisted by  + rblList[i]);
+}
 
-return;
-} catch (java.net.UnknownHostException uhe) {
-if (session.getLogger().isDebugEnabled()) {
-session.getLogger().debug(IpAddress  + 
session.getRemoteAddress().getAddress()  +  not listed on  + rblList[i]);
+return;
+} else {
+if (session.getLogger().isDebugEnabled()) {
+session.getLogger().debug(IpAddress  + 
session.getRemoteAddress().getAddress()  +  not listed on  + rblList[i]);
+}
 }
 }
 }
 
 if (blacklist != null) {
 String[] rblList = blacklist;
-for (int i = 0 ; i  rblList.length ; i++) try {
-dnsService.getByName(reversedOctets + rblList[i]);
-if (session.getLogger().isInfoEnabled

[jira] [Resolved] (PROTOCOLS-79) Remove DNSService interface

2012-01-01 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-79.


Resolution: Fixed

 Remove DNSService interface
 ---

 Key: PROTOCOLS-79
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-79
 Project: JAMES Protocols
  Issue Type: Task
  Components: smtp
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 We should remove the DNSService interface in the smtp module. Its not needed 
 for almost all handlers. For these that really need it we should move to 
 abstract classes.

--
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-80) Remove HandlersPackage interface

2012-01-01 Thread Norman Maurer (Created) (JIRA)
Remove HandlersPackage interface


 Key: PROTOCOLS-80
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-80
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


We should remove the HandlerPackage interface and its implementation. This is 
not needed at all as we have the various ProtocolHandlerChain implementations 
that take care of loading the right default handlers for a special protocol

--
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: r1226233 - /james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 11:14:00 2012
New Revision: 1226233

URL: http://svn.apache.org/viewvc?rev=1226233view=rev
Log:
Just some cleanup

Modified:

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java

Modified: 
james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java?rev=1226233r1=1226232r2=1226233view=diff
==
--- 
james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java
 (original)
+++ 
james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java
 Sun Jan  1 11:14:00 2012
@@ -105,6 +105,7 @@ public class MockLogger implements Logge
 }
 }
 }
+s.append(]);
 System.out.println(s.toString());
 if (t != null) {
 t.printStackTrace();



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



svn commit: r1226238 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/handler/ pop3/src/main/java/org/apache/james/protocols/pop3/ pop3/src/main/java/org/apache/james/prot

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 11:55:49 2012
New Revision: 1226238

URL: http://svn.apache.org/viewvc?rev=1226238view=rev
Log:
Remove HandlersPackage. See PROTOCOLS-80

Added:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
   (with props)
Removed:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/HandlersPackage.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/CoreCmdHandlerLoader.java

Added: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java?rev=1226238view=auto
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 (added)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 Sun Jan  1 11:55:49 2012
@@ -0,0 +1,87 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.protocols.pop3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.james.protocols.api.handler.CommandDispatcher;
+import org.apache.james.protocols.api.handler.ProtocolHandler;
+import org.apache.james.protocols.api.handler.ProtocolHandlerChainImpl;
+import org.apache.james.protocols.pop3.core.CapaCmdHandler;
+import org.apache.james.protocols.pop3.core.DeleCmdHandler;
+import org.apache.james.protocols.pop3.core.ListCmdHandler;
+import org.apache.james.protocols.pop3.core.NoopCmdHandler;
+import org.apache.james.protocols.pop3.core.PassCmdHandler;
+import org.apache.james.protocols.pop3.core.QuitCmdHandler;
+import org.apache.james.protocols.pop3.core.RetrCmdHandler;
+import org.apache.james.protocols.pop3.core.RsetCmdHandler;
+import org.apache.james.protocols.pop3.core.StatCmdHandler;
+import org.apache.james.protocols.pop3.core.StlsCmdHandler;
+import org.apache.james.protocols.pop3.core.TopCmdHandler;
+import org.apache.james.protocols.pop3.core.UidlCmdHandler;
+import org.apache.james.protocols.pop3.core.UnknownCmdHandler;
+import org.apache.james.protocols.pop3.core.UserCmdHandler;
+import org.apache.james.protocols.pop3.core.WelcomeMessageHandler;
+import org.apache.james.protocols.pop3.mailbox.MailboxFactory;
+
+public class POP3ProtocolHandlerChain extends ProtocolHandlerChainImpl{
+
+public POP3ProtocolHandlerChain() {
+this(null);
+}
+
+
+/**
+ * The {@link MailboxFactory} to use. If a codenot null/code {@link 
MailboxFactory} is given, the {@link POP3ProtocolHandlerChain}
+ * will add all default handlers
+ * 
+ * @param mailboxFactory
+ */
+public POP3ProtocolHandlerChain(MailboxFactory mailboxFactory) {
+if (mailboxFactory != null) {
+addAll(initDefaultHandlers(mailboxFactory));  
+}
+}
+
+protected ListProtocolHandler initDefaultHandlers(MailboxFactory 
mailboxFactory) {
+ListProtocolHandler handlers = new ArrayListProtocolHandler();
+handlers.add(new CapaCmdHandler());
+handlers.add(new UserCmdHandler());
+PassCmdHandler handler = new PassCmdHandler();
+handler.setMailboxFactory(mailboxFactory);
+handlers.add(handler);
+handlers.add(new ListCmdHandler());
+handlers.add(new UidlCmdHandler());
+handlers.add(new RsetCmdHandler());
+handlers.add(new DeleCmdHandler());
+handlers.add(new NoopCmdHandler());
+handlers.add(new RetrCmdHandler());
+handlers.add(new TopCmdHandler());
+handlers.add(new StatCmdHandler());
+handlers.add

[jira] [Resolved] (PROTOCOLS-80) Remove HandlersPackage interface

2012-01-01 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-80.


Resolution: Fixed

done

 Remove HandlersPackage interface
 

 Key: PROTOCOLS-80
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-80
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 We should remove the HandlerPackage interface and its implementation. This is 
 not needed at all as we have the various ProtocolHandlerChain implementations 
 that take care of loading the right default handlers for a special protocol

--
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-81) Add Logger adapter for Slf4j

2012-01-01 Thread Norman Maurer (Created) (JIRA)
Add Logger adapter for Slf4j 
-

 Key: PROTOCOLS-81
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-81
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


Add a logger adapter for Slf4j in the api module and mark the dependency as 
optional

--
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: r1226241 - in /james/protocols/trunk: ./ api/ api/src/main/java/org/apache/james/protocols/api/ api/src/main/java/org/apache/james/protocols/api/logger/ pop3/src/main/java/org/apache/james

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 12:10:26 2012
New Revision: 1226241

URL: http://svn.apache.org/viewvc?rev=1226241view=rev
Log:
Add Logger adapter for slf4j. See PROTOCOLS-81

Added:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Logger.java
   (contents, props changed)
  - copied, changed from r1224771, 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Logger.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/ProtocolSessionLogger.java
  - copied, changed from r1224771, 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionLogger.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/logger/Slf4jLogger.java
   (with props)
Removed:

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

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionLogger.java
Modified:
james/protocols/trunk/api/pom.xml

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

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

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

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
james/protocols/trunk/pom.xml

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Protocol.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3SessionImpl.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSessionImpl.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/MockLogger.java

Modified: james/protocols/trunk/api/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/pom.xml?rev=1226241r1=1226240r2=1226241view=diff
==
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Sun Jan  1 12:10:26 2012
@@ -33,6 +33,14 @@
 nameApache James Protocols API/name
 
 dependencies
+
+  !-- Logging frameworks - completely optional --
+dependency
+groupIdorg.slf4j/groupId
+artifactIdslf4j-api/artifactId
+scopecompile/scope
+optionaltrue/optional
+/dependency
 dependency
 groupIdjunit/groupId
 artifactIdjunit/artifactId

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/FutureResponseImpl.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/FutureResponseImpl.java?rev=1226241r1=1226240r2=1226241view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/FutureResponseImpl.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/FutureResponseImpl.java
 Sun Jan  1 12:10:26 2012
@@ -22,6 +22,8 @@ package org.apache.james.protocols.api;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.james.protocols.api.logger.Logger;
+
 /**
  * {@link FutureResponse} implementation which wraps a {@link 
AbstractResponse} implementation
  * 

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java?rev=1226241r1=1226240r2=1226241view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java
 Sun Jan  1 12:10:26 2012
@@ -20,6 +20,7 @@
 package org.apache.james.protocols.api;
 
 import org.apache.james.protocols.api.handler.ProtocolHandlerChain;
+import org.apache.james.protocols.api.logger.Logger;
 
 /**
  * Basic {@link Protocol} implementation 

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java?rev=1226241r1=1226240r2=1226241view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james

[jira] [Resolved] (PROTOCOLS-81) Add Logger adapter for Slf4j

2012-01-01 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-81.


Resolution: Fixed

done

 Add Logger adapter for Slf4j 
 -

 Key: PROTOCOLS-81
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-81
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 Add a logger adapter for Slf4j in the api module and mark the dependency as 
 optional

--
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: r1226242 - in /james/protocols/trunk: api/src/main/java/org/apache/james/protocols/api/ api/src/main/java/org/apache/james/protocols/api/future/ api/src/main/java/org/apache/james/protocol

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 12:12:30 2012
New Revision: 1226242

URL: http://svn.apache.org/viewvc?rev=1226242view=rev
Log:
Move future classes to extra package

Added:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureResponseImpl.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureStreamResponseImpl.java
Removed:

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

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

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

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/StartTlsFutureResponse.java
Modified:

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

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java

james/protocols/trunk/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java

james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.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=1226242r1=1226241r2=1226242view=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
 Sun Jan  1 12:12:30 2012
@@ -25,7 +25,8 @@ import java.util.List;
 import java.util.Queue;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import org.apache.james.protocols.api.FutureResponse.ResponseListener;
+import org.apache.james.protocols.api.future.FutureResponse;
+import org.apache.james.protocols.api.future.FutureResponse.ResponseListener;
 
 
 /**

Added: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java?rev=1226242view=auto
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java
 (added)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java
 Sun Jan  1 12:12:30 2012
@@ -0,0 +1,68 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.protocols.api.future;
+
+import org.apache.james.protocols.api.Response;
+
+/**
+ * An special {@link Response} which allows to populate it in an async 
fashion. It also allows to register listeners which will get notified once the 
+ * {@link FutureResponse} is ready
+ * 
+ *
+ */
+public interface FutureResponse extends Response{
+
+/**
+ * Add a {@link ResponseListener} which will get notified once {@link 
#isReady()} is true
+ * 
+ * @param listener
+ */
+public void addListener(ResponseListener listener);
+
+/**
+ * Remote a {@link ResponseListener}
+ * 
+ * @param listener
+ */
+public

[jira] [Created] (PROTOCOLS-82) Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration

2012-01-01 Thread Norman Maurer (Created) (JIRA)
Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration
-

 Key: PROTOCOLS-82
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-82
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


After refactor more in Protocols I realized that ProtocolHandlerLoader and 
ProtocolHandlerConfiguration should get removed as they are not needed

--
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-83) Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration

2012-01-01 Thread Norman Maurer (Created) (JIRA)
Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration
-

 Key: PROTOCOLS-83
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-83
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


After refactor more in Protocols I realized that ProtocolHandlerLoader and 
ProtocolHandlerConfiguration should get removed as they are not needed

--
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: r1226243 - in /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler: LifecycleAwareProtocolHandler.java ProtocolHandlerConfiguration.java ProtocolHandlerConfigura

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 12:15:55 2012
New Revision: 1226243

URL: http://svn.apache.org/viewvc?rev=1226243view=rev
Log:
Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration. See PROTOCOLS-83

Removed:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfiguration.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfigurationException.java

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerLoader.java
Modified:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java?rev=1226243r1=1226242r2=1226243view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
 Sun Jan  1 12:15:55 2012
@@ -25,15 +25,6 @@ package org.apache.james.protocols.api.h
  */
 public interface LifecycleAwareProtocolHandler extends ProtocolHandler{
 
-
-/**
- * Init with the given {@link ProtocolHandlerConfiguration}
- * 
- * @param config
- * @throws ProtocolHandlerConfigurationException
- */
-public void init(ProtocolHandlerConfiguration config) throws 
ProtocolHandlerConfigurationException;
-
 /**
  * Destroy object
  */



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



[jira] [Resolved] (PROTOCOLS-83) Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration

2012-01-01 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-83.


Resolution: Fixed

done

 Remove ProtocolHandlerLoader and ProtocolHandlerConfiguration
 -

 Key: PROTOCOLS-83
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-83
 Project: JAMES Protocols
  Issue Type: Task
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0


 After refactor more in Protocols I realized that ProtocolHandlerLoader and 
 ProtocolHandlerConfiguration should get removed as they are not needed

--
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: r1226244 - in /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api: ProtocolSession.java ProtocolSessionImpl.java handler/CommandDispatcher.java

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 12:21:48 2012
New Revision: 1226244

URL: http://svn.apache.org/viewvc?rev=1226244view=rev
Log:
Add getCharset() and getLineDelimiters() to ProtocolSession. See PROTOCOLS-78

Modified:

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

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

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java?rev=1226244r1=1226243r2=1226244view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
 Sun Jan  1 12:21:48 2012
@@ -20,6 +20,7 @@
 package org.apache.james.protocols.api;
 
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 import java.util.Map;
 
 import org.apache.james.protocols.api.logger.Logger;
@@ -158,5 +159,19 @@ public interface ProtocolSession {
  * @return config
  */
 ProtocolConfiguration getConfiguration();
+
+/**
+ * Return the {@link Charset} which is used by the {@link ProtocolSession}
+ * 
+ * @return charset
+ */
+Charset getCharset();
+
+/**
+ * Return the line delimiter which is used
+ * 
+ * @return delimiter
+ */
+String getLineDelimiter();
 
 }

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java?rev=1226244r1=1226243r2=1226244view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
 Sun Jan  1 12:21:48 2012
@@ -20,6 +20,7 @@
 package org.apache.james.protocols.api;
 
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -41,7 +42,9 @@ public class ProtocolSessionImpl impleme
 private final MapString, Object sessionState;
 private String user;
 protected final ProtocolConfiguration config;
-
+private final static Charset CHARSET = Charset.forName(US-ASCII);
+private final static String DELIMITER = \r\n;
+
 public ProtocolSessionImpl(Logger logger, ProtocolTransport transport, 
ProtocolConfiguration config) {
 this.transport = transport;
 this.pLog = new ProtocolSessionLogger(transport.getId(), logger);
@@ -198,4 +201,18 @@ public class ProtocolSessionImpl impleme
 }
 }
 
+/**
+ * Returns a Charset for US-ASCII
+ */
+public Charset getCharset() {
+return CHARSET;
+}
+
+/**
+ * Returns \r\n;
+ */
+public String getLineDelimiter() {
+return DELIMITER;
+}
+
 }

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java?rev=1226244r1=1226243r2=1226244view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
 Sun Jan  1 12:21:48 2012
@@ -211,7 +211,8 @@ public class CommandDispatcherSession e
 line = new byte[buffer.remaining()];
 buffer.get(line);
 }
-String cmdString = new String(line, getLineDecodingCharset()).trim();
+// This should be changed once we move to java6
+String cmdString = new String(line, 
session.getCharset().name()).trim();
 int spaceIndex = cmdString.indexOf( );
 if (spaceIndex  0) {
 curCommandName = cmdString.substring(0, spaceIndex);
@@ -229,12 +230,7 @@ public class CommandDispatcherSession e
 return request;
 
 }
-
-
-protected String getLineDecodingCharset() {
-return US-ASCII;
-}
-
+   
 /**
  * @see 
org.apache.james.protocols.api.handler.ExtensibleHandler#getMarkerInterfaces()
  */



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org

svn commit: r1226256 - in /james/protocols/trunk/smtp/src: main/java/org/apache/james/protocols/smtp/core/ main/java/org/apache/james/protocols/smtp/core/esmtp/ test/java/org/apache/james/protocols/sm

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 15:28:26 2012
New Revision: 1226256

URL: http://svn.apache.org/viewvc?rev=1226256view=rev
Log:
Add getCharset() and getLineDelimiters() to ProtocolSession. See PROTOCOLS-78

Modified:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java

james/protocols/trunk/smtp/src/test/java/org/apache/james/protocols/smtp/BaseFakeSMTPSession.java

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java?rev=1226256r1=1226255r2=1226256view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 Sun Jan  1 15:28:26 2012
@@ -102,15 +102,17 @@ public abstract class AbstractAddHeaders
 public final String value;
 
 private final String[] lines;
+private final String lineDelimiter;
 
-public Header(String name, String value) {
+public Header(String name, String value, String lineDelimiter) {
 this.name = name;
 this.value = value;
-this.lines = toString().split(\r\n);
+this.lines = toString().split(lineDelimiter);
+this.lineDelimiter = lineDelimiter;
 }
 
 public String toString() {
- return name + :  + value + \r\n;
+ return name + :  + value + lineDelimiter;
 }
 
 /**
@@ -124,17 +126,19 @@ public abstract class AbstractAddHeaders
  * @return response
  */
 public Response transferTo(SMTPSession session, 
LineHandlerSMTPSession handler) {
+String charset = session.getCharset().name();
+
 try {
 Response response = null;
 for (int i = 0; i  lines.length; i++) {
- response = handler.onLine(session, 
ByteBuffer.wrap((lines[i] + \r\n).getBytes(US-ASCII)));
+ response = handler.onLine(session, 
ByteBuffer.wrap((lines[i] + session.getLineDelimiter()).getBytes(charset)));
  if (response != null) {
  break;
  }
 }
 return response;
 } catch (UnsupportedEncodingException e) {
-throw new RuntimeException(NO US-ASCII ?, e);
+throw new RuntimeException(NO  + charset +  support ?, e);
 }
 }
 }

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java?rev=1226256r1=1226255r2=1226256view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
 Sun Jan  1 15:28:26 2012
@@ -107,7 +107,7 @@ public class ReceivedDataLineFilter exte
 if (heloName != null) {
 headerLineBuffer.append( ().append(heloMode).append( 
).append(heloName).append() );
 }
-headerLineBuffer.append( 
([).append(session.getRemoteAddress().getAddress().getHostAddress()).append(])).append(\r\n);
+headerLineBuffer.append( 
([).append(session.getRemoteAddress().getAddress().getHostAddress()).append(])).append(session.getLineDelimiter());
 headerLineBuffer.delete(0, headerLineBuffer.length());
 
 headerLineBuffer.append(Header.MULTI_LINE_PREFIX).append(by 
).append(session.getConfiguration().getHelloName()).append( 
().append(session.getConfiguration().getSoftwareName()).append() with 
).append(getServiceType(session, heloMode));
@@ -117,7 +117,7 @@ public class ReceivedDataLineFilter exte
 // Only indicate a recipient if they're the only recipient
 // (prevents email address harvesting and large headers in
 // bulk email)
-headerLineBuffer.append(\r\n);
+headerLineBuffer.append(session.getLineDelimiter());
 headerLineBuffer.append(Header.MULTI_LINE_PREFIX).append(for 
).append(((ListMailAddress) session.getAttachment(SMTPSession.RCPT_LIST

[jira] [Resolved] (PROTOCOLS-78) Add getCharset() and getLineDelimiters() to ProtocolSession

2012-01-01 Thread Norman Maurer (Resolved) (JIRA)

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

Norman Maurer resolved PROTOCOLS-78.


Resolution: Fixed

done

 Add getCharset() and getLineDelimiters() to ProtocolSession
 ---

 Key: PROTOCOLS-78
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-78
 Project: JAMES Protocols
  Issue Type: Improvement
  Components: api
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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: r1226258 - /james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 15:31:31 2012
New Revision: 1226258

URL: http://svn.apache.org/viewvc?rev=1226258view=rev
Log:
Add getCharset() and getLineDelimiters() to ProtocolSession. See PROTOCOLS-78

Modified:

james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java

Modified: 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java?rev=1226258r1=1226257r2=1226258view=diff
==
--- 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java
 (original)
+++ 
james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java
 Sun Jan  1 15:31:31 2012
@@ -31,9 +31,8 @@ import org.apache.james.protocols.api.Re
  */
 public interface LineHandlerSession extends ProtocolSession extends 
ProtocolHandler{
  
-public static final String CRLF = \r\n;
 /**
- * Processing the give line. The line includes the {@link #CRLF} delimiter.
+ * Processing the give line. The line includes the {@link 
ProtocolSession#getLineDelimiter()} delimiter.
  * If true is returned the connection is closed
  * 
  * @param session not null



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



svn commit: r1226259 - in /james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3: POP3ProtocolHandlerChain.java core/PassCmdHandler.java

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 15:38:43 2012
New Revision: 1226259

URL: http://svn.apache.org/viewvc?rev=1226259view=rev
Log:
Use constructor argument to give MailboxFactory to PassCmdHandler

Modified:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/PassCmdHandler.java

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java?rev=1226259r1=1226258r2=1226259view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 Sun Jan  1 15:38:43 2012
@@ -65,9 +65,7 @@ public class POP3ProtocolHandlerChain ex
 ListProtocolHandler handlers = new ArrayListProtocolHandler();
 handlers.add(new CapaCmdHandler());
 handlers.add(new UserCmdHandler());
-PassCmdHandler handler = new PassCmdHandler();
-handler.setMailboxFactory(mailboxFactory);
-handlers.add(handler);
+handlers.add(new PassCmdHandler(mailboxFactory));
 handlers.add(new ListCmdHandler());
 handlers.add(new UidlCmdHandler());
 handlers.add(new RsetCmdHandler());

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/PassCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/PassCmdHandler.java?rev=1226259r1=1226258r2=1226259view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/PassCmdHandler.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/core/PassCmdHandler.java
 Sun Jan  1 15:38:43 2012
@@ -40,12 +40,11 @@ public class PassCmdHandler extends Rset
 private static final Response UNEXPECTED_ERROR = new 
POP3Response(POP3Response.ERR_RESPONSE, Unexpected error accessing 
mailbox).immutable();
 private static final Response AUTH_FAILED = new 
POP3Response(POP3Response.ERR_RESPONSE, Authentication failed.).immutable();
 
-private MailboxFactory mailboxManager;
+private final MailboxFactory factory;
 
-public void setMailboxFactory(MailboxFactory manager) {
-this.mailboxManager = manager;
+public PassCmdHandler(MailboxFactory factory) {
+this.factory = factory;
 }
-
 /**
  * Handler method called upon receipt of a PASS command. Reads in and
  * validates the password.
@@ -56,7 +55,7 @@ public class PassCmdHandler extends Rset
 if (session.getHandlerState() == POP3Session.AUTHENTICATION_USERSET  
parameters != null) {
 String passArg = parameters;
 try {
-Mailbox mailbox = mailboxManager.getMailbox(session, passArg);
+Mailbox mailbox = factory.getMailbox(session, passArg);
 if (mailbox != null) {
 session.setUserMailbox(mailbox);
 stat(session);



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



svn commit: r1226260 - in /james/protocols/trunk/pop3: pom.xml src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java src/test/java/org/apache/james/protocols/pop3/TestUtils.java

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 16:13:29 2012
New Revision: 1226260

URL: http://svn.apache.org/viewvc?rev=1226260view=rev
Log:
Start to add unit tests for pop3. See PROTOCOLS-65

Added:

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
   (with props)

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/TestUtils.java
   (with props)
Modified:
james/protocols/trunk/pop3/pom.xml

Modified: james/protocols/trunk/pop3/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/pom.xml?rev=1226260r1=1226259r2=1226260view=diff
==
--- james/protocols/trunk/pop3/pom.xml (original)
+++ james/protocols/trunk/pop3/pom.xml Sun Jan  1 16:13:29 2012
@@ -38,6 +38,16 @@
 artifactIdprotocols-api/artifactId
 /dependency
 dependency
+groupIdcommons-net/groupId
+artifactIdcommons-net/artifactId
+scopetest/scope
+/dependency
+dependency
+groupIdorg.apache.james.protocols/groupId
+artifactIdprotocols-netty/artifactId
+scopetest/scope
+/dependency
+dependency
 groupIdjunit/groupId
 artifactIdjunit/artifactId
 scopetest/scope

Added: 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java?rev=1226260view=auto
==
--- 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
 (added)
+++ 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
 Sun Jan  1 16:13:29 2012
@@ -0,0 +1,132 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+package org.apache.james.protocols.pop3;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+
+import org.apache.commons.net.pop3.POP3Client;
+import org.apache.james.protocols.api.logger.Logger;
+import org.apache.james.protocols.netty.NettyServer;
+import org.apache.james.protocols.pop3.mailbox.Mailbox;
+import org.apache.james.protocols.pop3.mailbox.MailboxFactory;
+
+import org.junit.Test;
+
+public class POP3ServerTest {
+
+private POP3Protocol createProtocol(MailboxFactory factory) {
+return new POP3Protocol(new POP3ProtocolHandlerChain(factory), new 
POP3Configuration(), new Logger() {
+
+public void warn(String message, Throwable t) {
+
+}
+
+public void warn(String message) {
+
+}
+
+public void trace(String message, Throwable t) {
+
+}
+
+public void trace(String message) {
+
+}
+
+public boolean isWarnEnabled() {
+return false;
+}
+
+public boolean isTraceEnabled() {
+return false;
+}
+
+public boolean isInfoEnabled() {
+return false;
+}
+
+public boolean isErrorEnabled() {
+return false;
+}
+
+public boolean isDebugEnabled() {
+return false;
+}
+
+public void info(String message, Throwable t) {
+
+}
+
+public void info(String message

svn commit: r1226261 - in /james/protocols/trunk/pop3/src: main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java test/java/org/apache/james/protocols/pop3/MockLogger.java test/java/o

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 16:16:56 2012
New Revision: 1226261

URL: http://svn.apache.org/viewvc?rev=1226261view=rev
Log:
Correctly wire handlers in pop3 and also some minor work on tests.

Added:

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/MockLogger.java
   (with props)
Modified:

james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java

Modified: 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java?rev=1226261r1=1226260r2=1226261view=diff
==
--- 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 (original)
+++ 
james/protocols/trunk/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
 Sun Jan  1 16:16:56 2012
@@ -25,6 +25,7 @@ import java.util.List;
 import org.apache.james.protocols.api.handler.CommandDispatcher;
 import org.apache.james.protocols.api.handler.ProtocolHandler;
 import org.apache.james.protocols.api.handler.ProtocolHandlerChainImpl;
+import org.apache.james.protocols.api.handler.WiringException;
 import org.apache.james.protocols.pop3.core.CapaCmdHandler;
 import org.apache.james.protocols.pop3.core.DeleCmdHandler;
 import org.apache.james.protocols.pop3.core.ListCmdHandler;
@@ -45,7 +46,7 @@ import org.apache.james.protocols.pop3.m
 public class POP3ProtocolHandlerChain extends ProtocolHandlerChainImpl{
 
 public POP3ProtocolHandlerChain() {
-this(null);
+super();
 }
 
 
@@ -54,10 +55,12 @@ public class POP3ProtocolHandlerChain ex
  * will add all default handlers
  * 
  * @param mailboxFactory
+ * @throws WiringException 
  */
-public POP3ProtocolHandlerChain(MailboxFactory mailboxFactory) {
+public POP3ProtocolHandlerChain(MailboxFactory mailboxFactory) throws 
WiringException {
 if (mailboxFactory != null) {
 addAll(initDefaultHandlers(mailboxFactory));  
+wireExtensibleHandlers();
 }
 }
 

Added: 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/MockLogger.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/MockLogger.java?rev=1226261view=auto
==
--- 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/MockLogger.java
 (added)
+++ 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/MockLogger.java
 Sun Jan  1 16:16:56 2012
@@ -0,0 +1,129 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.protocols.pop3;
+
+import org.apache.james.protocols.api.logger.Logger;
+
+public class MockLogger implements Logger {
+
+public String getName() {
+return MockLogger to System out;
+}
+
+public boolean isTraceEnabled() {
+return true;
+}
+
+public void trace(String msg) {
+SysPrint(msg);
+}
+
+public void trace(String msg, Throwable t) {
+SysPrint(msg, t);
+}
+
+public boolean isDebugEnabled() {
+return true;
+}
+
+public void debug(String msg) {
+SysPrint(msg);
+}
+
+public void debug(String msg, Throwable t) {
+SysPrint(msg, t);
+}
+
+public boolean isInfoEnabled() {
+return true;
+}
+
+public void info(String msg) {
+SysPrint(msg);
+}
+
+public void info

svn commit: r1226298 - /james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java

2012-01-01 Thread norman
Author: norman
Date: Sun Jan  1 20:44:13 2012
New Revision: 1226298

URL: http://svn.apache.org/viewvc?rev=1226298view=rev
Log:
Start to add unit tests for pop3. See PROTOCOLS-65

Modified:

james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java

Modified: 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java?rev=1226298r1=1226297r2=1226298view=diff
==
--- 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
 (original)
+++ 
james/protocols/trunk/pop3/src/test/java/org/apache/james/protocols/pop3/POP3ServerTest.java
 Sun Jan  1 20:44:13 2012
@@ -18,17 +18,28 @@
  /
 package org.apache.james.protocols.pop3;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.SequenceInputStream;
 import java.net.InetSocketAddress;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.net.pop3.POP3Client;
+import org.apache.commons.net.pop3.POP3MessageInfo;
 import org.apache.james.protocols.api.handler.WiringException;
 import org.apache.james.protocols.netty.NettyServer;
 import org.apache.james.protocols.pop3.mailbox.Mailbox;
 import org.apache.james.protocols.pop3.mailbox.MailboxFactory;
+import org.apache.james.protocols.pop3.mailbox.MessageMetaData;
 
 import org.junit.Test;
 
@@ -62,10 +73,124 @@ public class POP3ServerTest {
 
 }
 
+@Test
+public void testEmptyInbox() throws Exception {
+InetSocketAddress address = new InetSocketAddress(127.0.0.1, 
TestUtils.getFreePort());
+
+NettyServer server = null;
+try {
+String identifier = id;
+MockMailboxFactory factory = new MockMailboxFactory();
+
+factory.add(valid, new MockMailbox(identifier));
+server = new NettyServer(createProtocol(factory));
+server.setListenAddresses(address);
+server.bind();
+
+POP3Client client =  new POP3Client();
+client.connect(address.getAddress().getHostAddress(), 
address.getPort());
+
+assertTrue(client.login(valid, valid));
+POP3MessageInfo[] info = client.listMessages();
+assertEquals(0, info.length);
+
+info = client.listUniqueIdentifiers();
+assertEquals(0, info.length);
+assertTrue(client.logout());
+   
+} finally {
+if (server != null) {
+server.unbind();
+}
+}
+
+}
 private final class MockMailboxFactory implements MailboxFactory {
-
+private final MapString, Mailbox mailboxes = new HashMapString, 
Mailbox();
+   
+public void add(String username, Mailbox mailbox) {
+mailboxes.put(username, mailbox);
+}
 public Mailbox getMailbox(POP3Session session, String password) throws 
IOException {
-return null;
+return mailboxes.get(session.getUser());
+}
+
+}
+
+private final class MockMailbox implements Mailbox {
+
+private final MapLong, Message messages = new HashMapLong, 
POP3ServerTest.Message();
+private final String identifier;
+
+public MockMailbox(String identifier, Message... messages) {
+this.identifier = identifier;
+for (Message m: messages) {
+this.messages.put(m.meta.getUid(), m);
+}
+}
+
+public MockMailbox(String identifier) {
+this(identifier, new Message[0]);
+}
+public InputStream getMessageBody(long uid) throws IOException {
+Message m = messages.get(uid);
+if (m == null) {
+return null;
+}
+return new ByteArrayInputStream(m.body.getBytes(US-ASCII));
+}
+
+public InputStream getMessageHeaders(long uid) throws IOException {
+Message m = messages.get(uid);
+if (m == null) {
+return null;
+}
+return new ByteArrayInputStream((m.headers + 
\r\n).getBytes(US-ASCII));
+}
+
+public InputStream getMessage(long uid) throws IOException {
+InputStream body = getMessageBody(uid);
+InputStream headers = getMessageHeaders(uid);
+if (body == null || headers == null

Re: Logging library in our projects

2011-12-31 Thread Norman Maurer
Hi Stefano,

I would even put the slf4j adapter into the api package. Then make it optional 
as you said. This will also work with osgi.

Bye,
Norman


-- 
Norman Maurer


Am Samstag, 31. Dezember 2011 um 15:03 schrieb Stefano Bagnara:

 2011/12/31 Eric Charles e...@apache.org (mailto:e...@apache.org):
  Hello Norman,
  
  Yes, I can understand this.
  
  So, how are we gonna create a POP3Protocol(ProtocolHandlerChain,
  ProtocolConfiguration, Logger) from server which uses slf4j?
  
  We need to give as third parameter a org.apache.james.protocols.api.Logger.
  
  An adapter between org.slf4j.Logger and
  org.apache.james.protocols.api.Logger could do the job, even if find this a
  bit overhead.
  
  When integrating server and protocols trunk a few days before, I thus though
  to these 2 options:
  1.- the adapter.
  2.- the uniformisation between all projects.
  
  but didn't know where to go..., this is the reason for this thread :)
  Maybe you have a third option in mind such as having two completely
  separated logging mechanism when running protocols in server?
  
 
 
 IMO we should go with #1 (using a private Logger interface and then
 use an adapter to slf4j).
 
 I also think that an slf4j adapter could be provided direclty in the
 protocols project and used as an optional dependency (so you don't
 have to write the adapter in every project).
 The right approach would be to have a protocols module with the
 slf4j adapter, but IMO a module for a single class is too much, so
 maybe we can simply put the adapter in the netty module or in the api
 module and then declare the slf4j dependency as optional, so that
 users of the library will decide if they want to use the slf4j logger
 or instead provide their own implementation.
 
 I'm not sure if this plays well with OSGi.
 
 Stefano
 
 -
 To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org 
 (mailto:server-dev-unsubscr...@james.apache.org)
 For additional commands, e-mail: server-dev-h...@james.apache.org 
 (mailto:server-dev-h...@james.apache.org)
 
 




Re: Logging library in our projects

2011-12-31 Thread Norman Maurer
Like I said, optional dependency works quite well with osgi. We did the same in 
netty.

Bye
Norman

Sent from my iPhone. Excuse any typos

Am 31.12.2011 um 15:52 schrieb Stefano Bagnara apa...@bago.org:

 2011/12/31 Eric Charles e...@apache.org:
 On 31/12/11 15:03, Stefano Bagnara wrote:
 
 but didn't know where to go..., this is the reason for this thread :)
 Maybe you have a third option in mind such as having two completely
 separated logging mechanism when running protocols in server?
 
 
 IMO we should go with #1 (using a private Logger interface and then
 use an adapter to slf4j).
 
 
 Hi Stefano,
 I am more in favor of #2 to keep things simple.
 For which reason do you prefer #1?
 
 Because as a user or a library I prefer to write an adapter (5
 minutes) instead of being forced to use a given logging toolkit.
 
 History clearly shown us that choosing a logging framework is never a
 good idea: just count how many products moved from one logger to
 another in the last 10 years. I bet 90% had to do that! So if a couple
 of interfaces allow us to encapsulate logging I think it is much
 better.
 
 Also, encapsulating it for a library gives one more opportunity as it
 allows the library user to intercept/monitor/alter the log calls.
 The best thing would be to name the specific logger interface
 something like Monitor (and not Logger) and use domain specific
 calls that will be converted to log calls only by the wrapper.
 
 We did this in mime4j and it worked fine (it even allowed us to
 introduce new features using the monitor in a special way to deal
 with strict/lenient parsing)!
 
 So, IMO, the best practice is that libraries should not provide
 logging at all. Logging is needed by applications (and not libraries)
 because the application user is an human and can't interface
 differently, instead library users are applications (or other
 libraries) so they can communicate much better than using a log file.
 
 I also think that an slf4j adapter could be provided direclty in the
 protocols project and used as an optional dependency (so you don't
 have to write the adapter in every project).
 The right approach would be to have a protocols module with the
 slf4j adapter, but IMO a module for a single class is too much, so
 maybe we can simply put the adapter in the netty module or in the api
 module and then declare the slf4j dependency as optional, so that
 users of the library will decide if they want to use the slf4j logger
 or instead provide their own implementation.
 
 
 Yes, it would be crazy to ask to all our library users to reimplement that
 adapter.
 
 To open the discussion more, I already saw (don't remember which ones) needs
 for a james-common that could be useful to all our projects. Some logging,
 streaming,... classes could perfectly fit there.
 
 I don't like the james-common solution as it would be one more
 dependency anyway and it doesn't make sense if it can be reduced by
 just adding 2 classes in each library.
 All of this PITA could have been skipped if only java.util.Logging
 provided an interface or commons-logging provided also an interface
 for the logger factory, but this never happened and I guess it won't
 happen anymore, so we are forced to do that.
 
 I'm not sure if this plays well with OSGi.
 
 
 No idea... but I don't see why it couldn't
 
 I have limited experience with OSGi but I remember optional
 dependencies created me some issue, but maybe this is because I was
 not skilled enough to deal with that... so I hope someone else
 (Norman) will answer this doubt.
 
 Stefano
 
 -
 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: Logging library in our projects

2011-12-31 Thread Norman Maurer
Hi Stefano,

to be honest I like the monitor idea but its a bit hard to implement in a 
useful way in the ProtocolSession. This is because users will write their own 
ProtocolHandler implementation and want to log different things there. How 
would you fulfill the need of that with a monitor ?

Thanks,
Norman


-- 
Norman Maurer


Am Samstag, 31. Dezember 2011 um 17:47 schrieb Stefano Bagnara:

 2011/12/31 Eric Charles e...@apache.org (mailto:e...@apache.org):
  A Logger is a logger.
 
 
 I agree, but then I would say that most times we abuse loggers :-)
 
  For monitoring purposes, I would not generalize the Logger to be a Monitor.
  But this is way beyond our discussion on the logging libraries :)
  
 
 
 Apple vs Oranges or better Aspects vs Pattern. Why can't you implement
 the Logging aspect of a given actor using a Monitor pattern?
 I find that if you use a monitor instead of plain local logging you
 also think better to the meaning of what you want to log and to the
 target of the log (user? developer? bug hunter?).
 Also a monitor can help during unit tests, instead standard logging
 doesn't help at all.
 
  mmh, for me everything is a library and a library needs logging.
 
 I don't agree.
 A book is a sorted collection of pages but if you take a bunch of
 random pages and add a number to it you can do something that looks
 like a book but I wouldn't call a book.
 
 So a library is a very specific subset of a bunch of classes.
 We could also create 2 distinct worlds of libraries: libraries using
 IO and libraries not using IO.
 
  An application is just a composition of libraries.
 
 An application is another subset of a bunch of classes, using IO,
 and providing a main function. You don't need composition to create
 an application, instead you need a main to do that!
 I can't really call every application a library.
 Every subset needs special consideration, so I'm not ready to find a
 one fit them all solution.
 
 (I'm not saying that mine explanation of words is better than your,
 just explaining how I used words, when I used them)
 
  If I follow your reasoning, nor protocols nor server would need logging?
 
 In my language, server is an application and needs logging. protocols
 is a library and should better use monitoring instead of logging. If
 server wants to log something happening in protocols then can simply
 monitor the procotols and log monitored things.
 
  Also, logging can be configured with appenders to log in database, jms
  queues... and even in mails (for error level for example) :)
  
 
 
 Sure, but it is not really easy to add monitorability ta library
 that makes use of logging.
 Instead is easy to add logging to a library that use a monitor pattern.
 
 So if we use a monitor like pattern (a dependency inject Logger
 interface , despite the name, is an implementation of a monitor) we
 allow users to define what to do.
 
 I love the approach of pico-container loggin (unfortunately I guess it
 is a dead project). I find this page really influenced my thought:
 http://svn.codehaus.org/picocontainer/java/2.x/trunk/logging/src/site/content/monitor-pattern.html
 
   I don't like the james-common solution as it would be one more
   dependency anyway and it doesn't make sense if it can be reduced by
   just adding 2 classes in each library.
   
  
  
  2 classes for logging, 3 more classes for something else, that could save us
  some code and maintenance, but yes, it also needs a release, that's not
  piece-of-cake...
  
 
 
 You would end up with a catch-all module where you put everything
 that is used by at least 2 modules.
 After few years using this approach you will have a 2MB catch-all
 library and your protocol library will depend on james-catchall, a
 2MB jar from which we only use 2 logging classes.
 
 Stefano
 
 -
 To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org 
 (mailto:server-dev-unsubscr...@james.apache.org)
 For additional commands, e-mail: server-dev-h...@james.apache.org 
 (mailto:server-dev-h...@james.apache.org)
 
 




svn commit: r1226180 - in /james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core: AbstractAddHeadersFilter.java ReceivedDataLineFilter.java SeparatingDataLineFilter.java

2011-12-31 Thread norman
Author: norman
Date: Sat Dec 31 19:14:11 2011
New Revision: 1226180

URL: http://svn.apache.org/viewvc?rev=1226180view=rev
Log:
Add abstract base classes for header and body filtering / modification. See 
PROTOCOLS-77

Added:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
   (with props)

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/SeparatingDataLineFilter.java
   (with props)
Modified:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java

Added: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java?rev=1226180view=auto
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 (added)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 Sat Dec 31 19:14:11 2011
@@ -0,0 +1,126 @@
+/
+ * 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 required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+package org.apache.james.protocols.smtp.core;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.util.Collection;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.james.protocols.api.ProtocolSession.State;
+import org.apache.james.protocols.api.Response;
+import org.apache.james.protocols.api.handler.LineHandler;
+import org.apache.james.protocols.smtp.SMTPSession;
+
+public abstract class AbstractAddHeadersFilter extends 
SeparatingDataLineFilter{
+
+private static final AtomicInteger COUNTER = new AtomicInteger(0);
+
+private final String headersPrefixAdded = HEADERS_PREFIX_ADDED + 
COUNTER.incrementAndGet();
+
+enum Location{
+Prefix,
+Suffix
+}
+
+/**
+ * Return the {@link Location} to add the headers in
+ * 
+ * @return location
+ */
+protected abstract Location getLocation();
+
+
+@Override
+protected Response onSeparatorLine(SMTPSession session, ByteBuffer line, 
LineHandlerSMTPSession next) {
+if (getLocation() == Location.Suffix  
session.getAttachment(headersPrefixAdded, State.Transaction) == null) { 
+session.setAttachment(headersPrefixAdded, Boolean.TRUE, 
State.Transaction);
+return addHeaders(session, line, next);
+}
+return super.onSeparatorLine(session, line, next);
+}
+
+@Override
+protected Response onHeadersLine(SMTPSession session, ByteBuffer line, 
LineHandlerSMTPSession next) {
+if (getLocation() == Location.Prefix) {
+return addHeaders(session, line, next);
+}
+return super.onHeadersLine(session, line, next);
+}
+
+private Response addHeaders(SMTPSession session, ByteBuffer line, 
LineHandlerSMTPSession next) {
+Response response;
+for (Header header: headers(session)) {
+response = header.transferTo(session, next);
+if (response != null) {
+return response;
+}
+}
+return next.onLine(session, line);
+}
+
+/**
+ * Return the {@link Header}'s to operate on
+ * 
+ * @return headers
+ */
+protected abstract CollectionHeader headers(SMTPSession session);
+
+public final static class Header {
+public final String name;
+public final String value;
+
+public Header(String name, String value) {
+this.name = name;
+this.value = value;
+}
+
+public

[jira] [Created] (PROTOCOLS-77) Add abstract base classes for header and body filtering / modification

2011-12-31 Thread Norman Maurer (Created) (JIRA)
Add abstract base classes for header and body filtering / modification
--

 Key: PROTOCOLS-77
 URL: https://issues.apache.org/jira/browse/PROTOCOLS-77
 Project: JAMES Protocols
  Issue Type: Improvement
  Components: lmtp, smtp
Affects Versions: 1.6.0-RC1
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 1.6.0




--
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: r1226183 - in /james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core: AbstractAddHeadersFilter.java ReceivedDataLineFilter.java

2011-12-31 Thread norman
Author: norman
Date: Sat Dec 31 19:19:37 2011
New Revision: 1226183

URL: http://svn.apache.org/viewvc?rev=1226183view=rev
Log:
Add abstract base classes for header and body filtering / modification. See 
PROTOCOLS-77

Modified:

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java

james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java?rev=1226183r1=1226182r2=1226183view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
 Sat Dec 31 19:19:37 2011
@@ -28,6 +28,11 @@ import org.apache.james.protocols.api.Re
 import org.apache.james.protocols.api.handler.LineHandler;
 import org.apache.james.protocols.smtp.SMTPSession;
 
+/**
+ * Abstract base class for {@link SeparatingDataLineFilter} implementations 
that add headers to a message
+ * 
+ *
+ */
 public abstract class AbstractAddHeadersFilter extends 
SeparatingDataLineFilter{
 
 private static final AtomicInteger COUNTER = new AtomicInteger(0);
@@ -63,7 +68,15 @@ public abstract class AbstractAddHeaders
 }
 return super.onHeadersLine(session, line, next);
 }
-
+   
+/**
+ * Add headers to the message
+ * 
+ * @param session
+ * @param line
+ * @param next
+ * @return response
+ */
 private Response addHeaders(SMTPSession session, ByteBuffer line, 
LineHandlerSMTPSession next) {
 Response response;
 for (Header header: headers(session)) {

Modified: 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java?rev=1226183r1=1226182r2=1226183view=diff
==
--- 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
 (original)
+++ 
james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
 Sat Dec 31 19:19:37 2011
@@ -30,6 +30,11 @@ import org.apache.james.protocols.api.Pr
 import org.apache.james.protocols.smtp.MailAddress;
 import org.apache.james.protocols.smtp.SMTPSession;
 
+/**
+ * {@link AbstractAddHeadersFilter} which adds the Received header for the 
message.
+ * 
+ *
+ */
 public class ReceivedDataLineFilter extends AbstractAddHeadersFilter {
 
 private static final ThreadLocalDateFormat DATEFORMAT = new 
ThreadLocalDateFormat() {
@@ -72,11 +77,17 @@ public class ReceivedDataLineFilter exte
 }
 }
 
+/**
+ * The Received header is added in front of the received headers. So 
returns {@link Location#Suffix}
+ */
 @Override
 protected Location getLocation() {
 return Location.Prefix;
 }
 
+/**
+ * Return the Received header for the message
+ */
 @SuppressWarnings(unchecked)
 @Override
 protected CollectionHeader headers(SMTPSession session) {



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



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