Re: Summer of Code End

2010-08-16 Thread Norman Maurer
Hi,

I would not worry about windows here. Maildir was not designed to work
at windows, so why should we try to do so ? IMHO, we should just not
support windows with this backend.

Bye,
Norman

2010/8/15 Tim-Christian Mundt d...@tim-erwin.de:
 Eric,

 Maildir is indeed - originally - not intended for Windows. I don't know
 of any other implementation supporting it. There is one main blocker:
 Windows doesn't allow colons in filenames. By instead using a different
 character (e.g. ;) we could support Maildir. Another problem could be
 that rename is not atomic on Windows and thus could leave the system
 with an inconsistent state. Anyways, it would work. I'll add Windows
 support and we should maybe add a note about this problem so that people
 are warned. James has so many nice(r) backends people can use on Win. At
 least from my point of view Maildir was mainly added to make migration
 from or interoperation with other software easier.
 Our Maildir is Maildir++, yes. We do not yet have quotas, however.

 Best,
 Tim

 Am Samstag, den 14.08.2010, 12:09 +0200 schrieb Eric Charles:
 btw, this is the first james store not portable on windows.
 Did you discover any maildir ports on windows during your GSOC ?
 Can we consider your impl as a Maildir++ one
 (http://en.wikipedia.org/wiki/Maildir) ?
 Tks,
 Eric


 On 08/14/2010 11:46 AM, Eric Charles wrote:
  Hi Tim,
 
  I checked-out, compiled, deployed and tested without any problem.
  Your MailDir store is working :) and generates the cur, new, tmp in my
  user directory.
 
  Last but not least, your code is really well structured and readable.
  You really made great job!
 
  Btw, we knew that James architecture was great open to alternative
  store, and you proved it.
 
  Quick comments:
  - I renamed /var/james/Maildirs/%user to ../var/Maildirs/%user (maybe
  should be file://var/...) to have relative paths to james deployment
  (more coherent with other stores)
  - I configured with JDBCDomainList and defined e...@localhost.net
  user. The created dir is /var/Maildirs/eric/ We may have user
  clash if let's say e...@otherdomain.net is defined.
 
  Tks,
 
  Eric
 
 
  On 08/13/2010 10:48 PM, Tim-Christian Mundt wrote:
  Hi guys,
 
  last Monday was pencils down for the Google Summer of Code project.
  The days till next Monday - the final dead line - are meant as time for
  wrap up, testing, documentation and so on.
 
  Well, the new Maildir backend works. Until now it has just one parameter
  which is the path (with variables) where the Maildir folders should
  reside. It works with pre-existing data from other servers or can build
  up the data from scratch. The functional tests work with the exception
  of testSearchCombinations* which is due to the fact that Maildir only
  stores the _current_ date as internal date, not the one that is given
  during append (which is perfectly valid for the RFC but not for the
  tests).
 
  The code is attached to this mail and you can also find it in my
  repository: svn://tim-erwin.de/maildir/trunk/maildir
  Although GSOC is officially over, I'm still open to cc and as soon as
  the code is in the James SVN it's open to be teared apart anyways.
 
  Thanks for having me in this project. Special thanks to Norman who has
  been a very helpful and nice to work with mentor. I'm sure this will not
  be the end of my James activities.
 
  Regards
  Tim
 
 
 
  -
  To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
  For additional commands, e-mail: server-dev-h...@james.apache.org
 

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



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



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



Re: Summer of Code End

2010-08-16 Thread Norman Maurer
Hi,

comments inside..

2010/8/15 Tim-Christian Mundt d...@tim-erwin.de:
 Hi Eric,

 thanks a lot for checking out and for your kind comments. James'
 Store-Architecture really makes it relatively easy (really relative) to
 implement new Storages which is definitely a big plus for James.

 Changing the path is a good idea. However, introducing the scheme
 (file://) would make the configuration more complicated and suggest that
 other protocols would also work, right?. If its still better I can add
 it, shouldn't be a big thing.


I think we should not add the scheme stuff. For JAMES Server we just
need to subclass it and use the FileSystem interface for lookup the
directory. No big deal ;)


 The path is not really well documented, it needs to be in the config. It
 can have three different variables: %user, %domain, %fulluser. You would
 either use something like /Maildirs/%domain/%user/ or /Maildirs/%
 fulluser


When thinking of vpopmail/courier-imap it use:
../%domain/%user/Maildir/

I think we should do the same..

 Regards
 Tim

 Am Samstag, den 14.08.2010, 11:46 +0200 schrieb Eric Charles:
 Hi Tim,

 I checked-out, compiled, deployed and tested without any problem.
 Your MailDir store is working :) and generates the cur, new, tmp in my
 user directory.

 Last but not least, your code is really well structured and readable.
 You really made great job!

 Btw, we knew that James architecture was great open to alternative
 store, and you proved it.

 Quick comments:
 - I renamed /var/james/Maildirs/%user to ../var/Maildirs/%user (maybe
 should be file://var/...) to have relative paths to james deployment
 (more coherent with other stores)
 - I configured with JDBCDomainList and defined e...@localhost.net user.
 The created dir is /var/Maildirs/eric/ We may have user clash if
 let's say e...@otherdomain.net is defined.

 Tks,

 Eric


 On 08/13/2010 10:48 PM, Tim-Christian Mundt wrote:
  Hi guys,
 
  last Monday was pencils down for the Google Summer of Code project.
  The days till next Monday - the final dead line - are meant as time for
  wrap up, testing, documentation and so on.
 
  Well, the new Maildir backend works. Until now it has just one parameter
  which is the path (with variables) where the Maildir folders should
  reside. It works with pre-existing data from other servers or can build
  up the data from scratch. The functional tests work with the exception
  of testSearchCombinations* which is due to the fact that Maildir only
  stores the _current_ date as internal date, not the one that is given
  during append (which is perfectly valid for the RFC but not for the
  tests).
 
  The code is attached to this mail and you can also find it in my
  repository: svn://tim-erwin.de/maildir/trunk/maildir
  Although GSOC is officially over, I'm still open to cc and as soon as
  the code is in the James SVN it's open to be teared apart anyways.
 
  Thanks for having me in this project. Special thanks to Norman who has
  been a very helpful and nice to work with mentor. I'm sure this will not
  be the end of my James activities.
 
  Regards
  Tim
 
 
 
 
  -
  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



Bye,
Norman

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



Re: Summer of Code End

2010-08-16 Thread Eric Charles

 Hi,

With file:// , I was referring to james nomenclature (ex: 
file://conf/... for files in james conf dir, file://var/... for files 
in james var dir), and not to the URI/URL patterns.
You can find plenty of this nomenclature in spring-beans.xml,... (ex: 
file://conf/database.properties)


The other James nomenclature is classpath://.
We may remain with confusions with the James vs. URL/URI file://, but 
i think we could discuss a bit later in the frame of OSGI stuff,...


../var/... can perfectly do the job now.

Nice to read we can use %domain and %user variables.
May be the default in spring-beans.xml could be  
../var/Maildir/%domain/%user/Maildir or whatever, so we know we can 
play with domain / user structure.


Tks,

Eric


On 16/08/2010 08:26, Norman Maurer wrote:

Hi,

comments inside..

2010/8/15 Tim-Christian Mundtd...@tim-erwin.de:

Hi Eric,

thanks a lot for checking out and for your kind comments. James'
Store-Architecture really makes it relatively easy (really relative) to
implement new Storages which is definitely a big plus for James.

Changing the path is a good idea. However, introducing the scheme
(file://) would make the configuration more complicated and suggest that
other protocols would also work, right?. If its still better I can add
it, shouldn't be a big thing.


I think we should not add the scheme stuff. For JAMES Server we just
need to subclass it and use the FileSystem interface for lookup the
directory. No big deal ;)



The path is not really well documented, it needs to be in the config. It
can have three different variables: %user, %domain, %fulluser. You would
either use something like /Maildirs/%domain/%user/ or /Maildirs/%
fulluser


When thinking of vpopmail/courier-imap it use:
../%domain/%user/Maildir/

I think we should do the same..


Regards
Tim

Am Samstag, den 14.08.2010, 11:46 +0200 schrieb Eric Charles:

Hi Tim,

I checked-out, compiled, deployed and tested without any problem.
Your MailDir store is working :) and generates the cur, new, tmp in my
user directory.

Last but not least, your code is really well structured and readable.
You really made great job!

Btw, we knew that James architecture was great open to alternative
store, and you proved it.

Quick comments:
- I renamed /var/james/Maildirs/%user to ../var/Maildirs/%user (maybe
should be file://var/...) to have relative paths to james deployment
(more coherent with other stores)
- I configured with JDBCDomainList and defined e...@localhost.net user.
The created dir is /var/Maildirs/eric/ We may have user clash if
let's say e...@otherdomain.net is defined.

Tks,

Eric


On 08/13/2010 10:48 PM, Tim-Christian Mundt wrote:

Hi guys,

last Monday was pencils down for the Google Summer of Code project.
The days till next Monday - the final dead line - are meant as time for
wrap up, testing, documentation and so on.

Well, the new Maildir backend works. Until now it has just one parameter
which is the path (with variables) where the Maildir folders should
reside. It works with pre-existing data from other servers or can build
up the data from scratch. The functional tests work with the exception
of testSearchCombinations* which is due to the fact that Maildir only
stores the _current_ date as internal date, not the one that is given
during append (which is perfectly valid for the RFC but not for the
tests).

The code is attached to this mail and you can also find it in my
repository: svn://tim-erwin.de/maildir/trunk/maildir
Although GSOC is officially over, I'm still open to cc and as soon as
the code is in the James SVN it's open to be teared apart anyways.

Thanks for having me in this project. Special thanks to Norman who has
been a very helpful and nice to work with mentor. I'm sure this will not
be the end of my James activities.

Regards
Tim




-
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



Bye,
Norman

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




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



[jira] Created: (IMAP-197) Upgrade to jackrabbit 2.1.1

2010-08-16 Thread Norman Maurer (JIRA)
Upgrade to jackrabbit 2.1.1
---

 Key: IMAP-197
 URL: https://issues.apache.org/jira/browse/IMAP-197
 Project: JAMES Imap
  Issue Type: Task
  Components: JCR Mailbox
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.1




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



svn commit: r986060 - in /james/imap/trunk: deployment/src/test/java/org/apache/james/imap/functional/ImapHostSystem.java jcr/pom.xml memory/src/test/java/org/apache/james/imap/functional/inmemory/InM

2010-08-16 Thread norman
Author: norman
Date: Mon Aug 16 17:23:41 2010
New Revision: 986060

URL: http://svn.apache.org/viewvc?rev=986060view=rev
Log:
Make sure jcr tests work with java6 and java5

Modified:

james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/ImapHostSystem.java
james/imap/trunk/jcr/pom.xml

james/imap/trunk/memory/src/test/java/org/apache/james/imap/functional/inmemory/InMemoryHostSystem.java
james/imap/trunk/parent/pom.xml

Modified: 
james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/ImapHostSystem.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/ImapHostSystem.java?rev=986060r1=986059r2=986060view=diff
==
--- 
james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/ImapHostSystem.java
 (original)
+++ 
james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/ImapHostSystem.java
 Mon Aug 16 17:23:41 2010
@@ -248,8 +248,6 @@ public abstract class ImapHostSystem imp
 }
 }
 
-public abstract boolean addUser(String user, String password) throws 
Exception;
-
 public void afterTests() throws Exception {
 // default do nothing
 }

Modified: james/imap/trunk/jcr/pom.xml
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/jcr/pom.xml?rev=986060r1=986059r2=986060view=diff
==
--- james/imap/trunk/jcr/pom.xml (original)
+++ james/imap/trunk/jcr/pom.xml Mon Aug 16 17:23:41 2010
@@ -44,12 +44,13 @@
   artifactIdapache-james-imap-store/artifactId
 /dependency
 
+!--
 dependency
   groupIdorg.apache.torque/groupId
   artifactIdtorque-runtime/artifactId
   scopetest/scope
 /dependency
-
+--
 dependency
   groupIdorg.apache.james/groupId
   artifactIdapache-james-imap-deployment/artifactId
@@ -93,14 +94,14 @@
   artifactIdjackrabbit-core/artifactId
 /dependency
 dependency
-  groupIdorg.apache.james/groupId
-  artifactIdapache-james-imap-jcr/artifactId
-  scopetest/scope
-/dependency
-dependency
   groupIdorg.apache.jackrabbit/groupId
   artifactIdjackrabbit-jcr-commons/artifactId
 /dependency
+!-- needed for some java versions --
+dependency
+  groupIdxerces/groupId
+  artifactIdxercesImpl/artifactId
+/dependency
 
   /dependencies
 

Modified: 
james/imap/trunk/memory/src/test/java/org/apache/james/imap/functional/inmemory/InMemoryHostSystem.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/memory/src/test/java/org/apache/james/imap/functional/inmemory/InMemoryHostSystem.java?rev=986060r1=986059r2=986060view=diff
==
--- 
james/imap/trunk/memory/src/test/java/org/apache/james/imap/functional/inmemory/InMemoryHostSystem.java
 (original)
+++ 
james/imap/trunk/memory/src/test/java/org/apache/james/imap/functional/inmemory/InMemoryHostSystem.java
 Mon Aug 16 17:23:41 2010
@@ -50,7 +50,6 @@ public class InMemoryHostSystem extends 
 defaultImapProcessorFactory.buildImapProcessor());
 }
 
-@Override
 public boolean addUser(String user, String password) throws Exception {
 userManager.addUser(user, password);
 return true;

Modified: james/imap/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/parent/pom.xml?rev=986060r1=986059r2=986060view=diff
==
--- james/imap/trunk/parent/pom.xml (original)
+++ james/imap/trunk/parent/pom.xml Mon Aug 16 17:23:41 2010
@@ -541,11 +541,18 @@
 scopetest/scope
   /dependency
   dependency
-  groupIdorg.slf4j/groupId
-  artifactIdslf4j-log4j12/artifactId
-  version1.5.7/version
-  scopetest/scope
-/dependency
+groupIdorg.slf4j/groupId
+artifactIdslf4j-log4j12/artifactId
+version1.5.7/version
+scopetest/scope
+  /dependency
+  
+  dependency
+groupIdxerces/groupId
+artifactIdxercesImpl/artifactId
+version2.9.1/version
+scopetest/scope
+  /dependency
   !-- 
 END JCR
   --



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



svn commit: r986062 - in /james/imap/trunk/maildir: LICENSE.txt NOTICE.txt pom.xml src/

2010-08-16 Thread norman
Author: norman
Date: Mon Aug 16 17:25:19 2010
New Revision: 986062

URL: http://svn.apache.org/viewvc?rev=986062view=rev
Log:
Cleanup for maildir import :)

Removed:
james/imap/trunk/maildir/LICENSE.txt
james/imap/trunk/maildir/NOTICE.txt
james/imap/trunk/maildir/pom.xml
james/imap/trunk/maildir/src/


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



svn commit: r986064 - /james/imap/trunk/parent/pom.xml

2010-08-16 Thread norman
Author: norman
Date: Mon Aug 16 17:26:22 2010
New Revision: 986064

URL: http://svn.apache.org/viewvc?rev=986064view=rev
Log:
Upgrade to jackrabbit 2.1.1 (IMAP-197)

Modified:
james/imap/trunk/parent/pom.xml

Modified: james/imap/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/parent/pom.xml?rev=986064r1=986063r2=986064view=diff
==
--- james/imap/trunk/parent/pom.xml (original)
+++ james/imap/trunk/parent/pom.xml Mon Aug 16 17:26:22 2010
@@ -532,12 +532,12 @@
   dependency
 groupIdorg.apache.jackrabbit/groupId
 artifactIdjackrabbit-jcr-commons/artifactId
-version2.1.0/version
+version2.1.1/version
   /dependency
   dependency
 groupIdorg.apache.jackrabbit/groupId
 artifactIdjackrabbit-core/artifactId
-version2.1.0/version
+version2.1.1/version
 scopetest/scope
   /dependency
   dependency



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



[jira] Assigned: (IMAP-101) Add a file based Mailbox implementation using the maildir layout

2010-08-16 Thread Norman Maurer (JIRA)

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

Norman Maurer reassigned IMAP-101:
--

Assignee: Norman Maurer

 Add a file based Mailbox implementation using the maildir layout
 

 Key: IMAP-101
 URL: https://issues.apache.org/jira/browse/IMAP-101
 Project: JAMES Imap
  Issue Type: New Feature
  Components: Maildir Mailbox
Reporter: Norman Maurer
Assignee: Norman Maurer
 Attachments: apache-james-imap-maildir.zip, maildir-imap.patch


 I would like to have support for file bases Mailbox using the maildir layout 
 in the IMAP project.
 More infos about the maildir layout:
 http://www.qmail.org/qmail-manual-html/man5/maildir.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



svn commit: r986070 - /james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java

2010-08-16 Thread norman
Author: norman
Date: Mon Aug 16 17:37:00 2010
New Revision: 986070

URL: http://svn.apache.org/viewvc?rev=986070view=rev
Log:
Add more wildcard matching for IsInWhitelist

Modified:

james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java

Modified: 
james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java?rev=986070r1=986069r2=986070view=diff
==
--- 
james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java
 (original)
+++ 
james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/IsInWhiteList.java
 Mon Aug 16 17:37:00 2010
@@ -124,6 +124,32 @@ public class IsInWhiteList extends Abstr
 // This address was already in the list
 return true;
 }
+
+
+// check for wildcard recipient domain entries 
+selectStmt = conn.prepareStatement(selectByPK);
+
+selectStmt.setString(1, *);
+selectStmt.setString(2, recipientHost);
+selectStmt.setString(3, senderUser);
+selectStmt.setString(4, senderHost);
+selectRS = selectStmt.executeQuery();
+if (selectRS.next()) {
+// This address was already in the list
+return true;
+}
+// check for wildcard domain entries on both 
+selectStmt = conn.prepareStatement(selectByPK);
+
+selectStmt.setString(1, *);
+selectStmt.setString(2, recipientHost);
+selectStmt.setString(3, *);
+selectStmt.setString(4, senderHost);
+selectRS = selectStmt.executeQuery();
+if (selectRS.next()) {
+// This address was already in the list
+return true;
+}
 
 } finally {
 theJDBCUtil.closeJDBCResultSet(selectRS);



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



[jira] Reopened: (IMAP-101) Add a file based Mailbox implementation using the maildir layout

2010-08-16 Thread Norman Maurer (JIRA)

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

Norman Maurer reopened IMAP-101:



 Add a file based Mailbox implementation using the maildir layout
 

 Key: IMAP-101
 URL: https://issues.apache.org/jira/browse/IMAP-101
 Project: JAMES Imap
  Issue Type: New Feature
  Components: Maildir Mailbox
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.1

 Attachments: apache-james-imap-maildir.zip, maildir-imap.patch


 I would like to have support for file bases Mailbox using the maildir layout 
 in the IMAP project.
 More infos about the maildir layout:
 http://www.qmail.org/qmail-manual-html/man5/maildir.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



svn commit: r986076 [3/3] - in /james/imap/trunk: ./ maildir/ maildir/src/ maildir/src/main/ maildir/src/main/java/ maildir/src/main/java/org/ maildir/src/main/java/org/apache/ maildir/src/main/java/o

2010-08-16 Thread norman
Added: 
james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/user/MaildirSubscriptionMapper.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/user/MaildirSubscriptionMapper.java?rev=986076view=auto
==
--- 
james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/user/MaildirSubscriptionMapper.java
 (added)
+++ 
james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/user/MaildirSubscriptionMapper.java
 Mon Aug 16 17:55:26 2010
@@ -0,0 +1,199 @@
+/
+ * 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.imap.maildir.user;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.james.imap.api.display.HumanReadableText;
+import org.apache.james.imap.mailbox.MailboxException;
+import org.apache.james.imap.mailbox.SubscriptionException;
+import org.apache.james.imap.maildir.user.model.MaildirSubscription;
+import org.apache.james.imap.store.user.SubscriptionMapper;
+import org.apache.james.imap.store.user.model.Subscription;
+
+public class MaildirSubscriptionMapper implements SubscriptionMapper {
+
+private static final String PATH_USER = %user;
+private static final String FILE_SUBSCRIPTION = subscriptions;
+private final String maildirLocation;
+
+public MaildirSubscriptionMapper(String maildirLocation) {
+this.maildirLocation = maildirLocation;
+}
+
+/* 
+ * (non-Javadoc)
+ * @see 
org.apache.james.imap.store.user.SubscriptionMapper#delete(org.apache.james.imap.store.user.model.Subscription)
+ */
+public void delete(Subscription subscription) throws SubscriptionException 
{
+ // TODO: we need some kind of file locking here
+SetString subscriptionNames = 
readSubscriptionsForUser(subscription.getUser());
+boolean changed = subscriptionNames.remove(subscription.getMailbox());
+if (changed) {
+try {
+writeSubscriptions(new 
File(createFolderNameFromUser(subscription.getUser())), subscriptionNames);
+} catch (IOException e) {
+throw new 
SubscriptionException(HumanReadableText.GENERIC_SUBSCRIPTION_FAILURE);
+}
+}
+}
+
+/* 
+ * (non-Javadoc)
+ * @see 
org.apache.james.imap.store.user.SubscriptionMapper#findSubscriptionsForUser(java.lang.String)
+ */
+public ListSubscription findSubscriptionsForUser(String user) throws 
SubscriptionException {
+SetString subscriptionNames = readSubscriptionsForUser(user);
+ArrayListSubscription subscriptions = new ArrayListSubscription();
+for (String subscription : subscriptionNames) {
+subscriptions.add(new MaildirSubscription(user, subscription));
+}
+return subscriptions;
+}
+
+/* 
+ * (non-Javadoc)
+ * @see 
org.apache.james.imap.store.user.SubscriptionMapper#findMailboxSubscriptionForUser(java.lang.String,
 java.lang.String)
+ */
+public Subscription findMailboxSubscriptionForUser(String user, String 
mailbox) throws SubscriptionException {
+File userRoot = new File(createFolderNameFromUser(user));
+SetString subscriptionNames;
+try {
+subscriptionNames = readSubscriptions(userRoot);
+} catch (IOException e) {
+throw new 
SubscriptionException(HumanReadableText.GENERIC_SUBSCRIPTION_FAILURE);
+}
+if (subscriptionNames.contains(mailbox))
+return new 

[jira] Created: (JDKIM-19) Change scope on 2 variables in DKIMSign to support subclassing

2010-08-16 Thread Jerry Malcolm (JIRA)
Change scope on 2 variables in DKIMSign to support subclassing
--

 Key: JDKIM-19
 URL: https://issues.apache.org/jira/browse/JDKIM-19
 Project: JAMES jDKIM
  Issue Type: Improvement
  Components: mailet
 Environment: software, mailet
Reporter: Jerry Malcolm


I need to have separate private keys for DKIM for different domains that I
host on my server.  I plan to create a database table that looks up the
private key based on the domain.  I figured I could subclass your DKIMSign
mailet, override the service method, set the privateKey and
signatureTemplate variables and then call the parent service method.  But it
turns out that the privateKey and signatureTemplate variables are scoped to
'private'.  I know I can just clone the entire method or even the entire
java class file.  But I'd much prefer to inherit everything other than that
one little change I need.  But I can't do it with private scope on the key
and template.

Request to change scope on pfivateKey and signatureTemplate variables from 
private to protected to support subclassing of this mailet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



[jira] Resolved: (IMAP-101) Add a file based Mailbox implementation using the maildir layout

2010-08-16 Thread Norman Maurer (JIRA)

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

Norman Maurer resolved IMAP-101.


Resolution: Fixed

Committed... Thx again for all the hard work mate :)

 Add a file based Mailbox implementation using the maildir layout
 

 Key: IMAP-101
 URL: https://issues.apache.org/jira/browse/IMAP-101
 Project: JAMES Imap
  Issue Type: New Feature
  Components: Maildir Mailbox
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.1

 Attachments: apache-james-imap-maildir.zip, maildir-imap.patch


 I would like to have support for file bases Mailbox using the maildir layout 
 in the IMAP project.
 More infos about the maildir layout:
 http://www.qmail.org/qmail-manual-html/man5/maildir.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



[jira] Created: (IMAP-198) Tests must get skipped on windows

2010-08-16 Thread Norman Maurer (JIRA)
Tests must get skipped on windows
-

 Key: IMAP-198
 URL: https://issues.apache.org/jira/browse/IMAP-198
 Project: JAMES Imap
  Issue Type: Task
  Components: Maildir Mailbox
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.1


Maildir does not work on windows so skip the tests on it 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



svn commit: r986084 - /james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/

2010-08-16 Thread norman
Author: norman
Date: Mon Aug 16 18:13:32 2010
New Revision: 986084

URL: http://svn.apache.org/viewvc?rev=986084view=rev
Log:
Skip tests on windows because maildir is not working on windows by design 
(IMAP-198)

Added:

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/OsDetector.java
Modified:

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/AuthenticatedStateTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ConcurrentSessionsTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/EventTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ExpungeTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/FetchBodySectionTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/FetchBodyStructureTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/FetchHeadersTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/FetchTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ListingTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/MaildirStressTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/NonAuthenticatedStateTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/PartialFetchTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/RenameTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/SecurityTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/SelectTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/SelectedInboxTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/SelectedStateTest.java

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java

Modified: 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/AuthenticatedStateTest.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/AuthenticatedStateTest.java?rev=986084r1=986083r2=986084view=diff
==
--- 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/AuthenticatedStateTest.java
 (original)
+++ 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/AuthenticatedStateTest.java
 Mon Aug 16 18:13:32 2010
@@ -26,4 +26,15 @@ public class AuthenticatedStateTest exte
 public AuthenticatedStateTest() throws Exception {
 super(MaildirHostSystem.build());
 }
+
+@Override
+protected void runSessions() throws Exception {
+if (OsDetector.isWindows()) {
+System.out.println(Maildir tests work only on non-windows 
systems. So skip the test);
+} else {
+super.runSessions(); 
+}
+}
+
+
 }

Modified: 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ConcurrentSessionsTest.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ConcurrentSessionsTest.java?rev=986084r1=986083r2=986084view=diff
==
--- 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ConcurrentSessionsTest.java
 (original)
+++ 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/ConcurrentSessionsTest.java
 Mon Aug 16 18:13:32 2010
@@ -28,4 +28,14 @@ public class ConcurrentSessionsTest exte
 super(MaildirHostSystem.build());
 }
 
+
+@Override
+protected void runSessions() throws Exception {
+if (OsDetector.isWindows()) {
+System.out.println(Maildir tests work only on non-windows 
systems. So skip the test);
+} else {
+super.runSessions(); 
+}
+}
+
 }

Modified: 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/EventTest.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/EventTest.java?rev=986084r1=986083r2=986084view=diff
==
--- 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/EventTest.java
 (original)
+++ 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/EventTest.java
 Mon Aug 16 18:13:32 2010
@@ -27,4 

[jira] Resolved: (IMAP-198) Tests must get skipped on windows

2010-08-16 Thread Norman Maurer (JIRA)

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

Norman Maurer resolved IMAP-198.


Resolution: Fixed

done

 Tests must get skipped on windows
 -

 Key: IMAP-198
 URL: https://issues.apache.org/jira/browse/IMAP-198
 Project: JAMES Imap
  Issue Type: Task
  Components: Maildir Mailbox
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.1


 Maildir does not work on windows so skip the tests on it 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



svn commit: r986087 - /james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java

2010-08-16 Thread norman
Author: norman
Date: Mon Aug 16 18:23:48 2010
New Revision: 986087

URL: http://svn.apache.org/viewvc?rev=986087view=rev
Log:
Skip tests which not work with maildir and are optional

Modified:

james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java

Modified: 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java?rev=986087r1=986086r2=986087view=diff
==
--- 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java
 (original)
+++ 
james/imap/trunk/maildir/src/test/java/org/apache/james/imap/functional/maildir/UidSearchTest.java
 Mon Aug 16 18:23:48 2010
@@ -20,6 +20,7 @@
 package org.apache.james.imap.functional.maildir;
 
 import org.apache.james.imap.functional.suite.UidSearch;
+import org.junit.Test;
 
 public class UidSearchTest extends UidSearch{
 
@@ -28,6 +29,24 @@ public class UidSearchTest extends UidSe
 }
 
 
+@Test
+public void testSearchCombinationsUS() throws Exception {
+// skipped because of maildir does use the create time for internal 
date 
+// which is ok with the rfc but fail the test
+}
+
+@Test
+public void testSearchCombinationsITALY() throws Exception {
+// skipped because of maildir does use the create time for internal 
date 
+// which is ok with the rfc but fail the test
+}
+
+@Test
+public void testSearchCombinationsKOREA() throws Exception {
+// skipped because of maildir does use the create time for internal 
date 
+// which is ok with the rfc but fail the test
+}
+
 @Override
 protected void runSessions() throws Exception {
 if (OsDetector.isWindows()) {



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



[jira] Resolved: (IMAP-187) Move tests from functional project to their store projects

2010-08-16 Thread Eric Charles (JIRA)

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

Eric Charles resolved IMAP-187.
---

Resolution: Fixed

Norman was quick to solve the torque dependency 
http://svn.apache.org/viewvc?view=revisionrevision=986060 (I was testing on 
jdk 6).
Probably JCR would have failed on jdk6 not only with test, but also as real 
store.
So it was useful to split the store tests in their projects (think unit test).
We can close it now.


 Move tests from functional project to their store projects
 --

 Key: IMAP-187
 URL: https://issues.apache.org/jira/browse/IMAP-187
 Project: JAMES Imap
  Issue Type: Task
Reporter: Eric Charles
Priority: Minor

 Common tests should remain in imap-deployment.
 Store specific tests should be moved to their store projects (imap-jcr, 
 imap-jpa,...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



[jira] Closed: (IMAP-187) Move tests from functional project to their store projects

2010-08-16 Thread Eric Charles (JIRA)

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

Eric Charles closed IMAP-187.
-


 Move tests from functional project to their store projects
 --

 Key: IMAP-187
 URL: https://issues.apache.org/jira/browse/IMAP-187
 Project: JAMES Imap
  Issue Type: Task
Reporter: Eric Charles
Priority: Minor

 Common tests should remain in imap-deployment.
 Store specific tests should be moved to their store projects (imap-jcr, 
 imap-jpa,...)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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