You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2008/12/03 12:15:40 UTC

svn commit: r722841 - in /james/server/trunk: imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ stage/org.apache.james/jars/

Author: rdonkin
Date: Wed Dec  3 03:15:39 2008
New Revision: 722841

URL: http://svn.apache.org/viewvc?rev=722841&view=rev
Log:
Updated to latest JSieve SNAPSHOT

Added:
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java
Modified:
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
    james/server/trunk/stage/org.apache.james/jars/apache-jsieve-0.3-SNAPSHOT.jar
    james/server/trunk/stage/org.apache.james/jars/apache-jsieve-mailet-0.3-SNAPSHOT.jar

Added: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java?rev=722841&view=auto
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java (added)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java Wed Dec  3 03:15:39 2008
@@ -0,0 +1,42 @@
+/****************************************************************
+ * 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.imapserver.sieve;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.jsieve.mailet.ResourceLocator;
+
+/**
+ * To maintain backwards compatibility with existing
+ * installations, this uses the old file based scheme.
+ * TODO: replace with <code>FileSystem</code> based implementation.
+ */
+public class ResourceLocatorImpl implements ResourceLocator {
+
+    public InputStream get(String uri) throws IOException {
+        // This is a toy implementation
+        String username = uri.substring(3, uri.indexOf('@'));
+        String sieveFileName = "../apps/james/var/sieve/"+username+".sieve";
+        return new FileInputStream(sieveFileName);
+    }
+
+}

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java?rev=722841&r1=722840&r2=722841&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java (original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java Wed Dec  3 03:15:39 2008
@@ -25,19 +25,19 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.james.Constants;
 import org.apache.jsieve.mailet.Poster;
-import org.apache.jsieve.mailet.SieveToMultiMailbox;
+import org.apache.jsieve.mailet.SieveMailboxMailet;
 import org.apache.mailet.MailetConfig;
 
 /**
  * Contains avalon bindings.
  */
-public class SieveMailet extends SieveToMultiMailbox {
+public class SieveMailet extends SieveMailboxMailet {
 
     @Override
     public void init(MailetConfig config) throws MessagingException {
         ServiceManager compMgr = (ServiceManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
         try {
-            Poster poster = (Poster) compMgr.lookup("");
+            Poster poster = (Poster) compMgr.lookup("org.apache.jsieve.mailet.Poster");
             setPoster(poster);
         } catch (ServiceException e) {
             throw new MessagingException("IMAP not installed", e);

Modified: james/server/trunk/stage/org.apache.james/jars/apache-jsieve-0.3-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/james/server/trunk/stage/org.apache.james/jars/apache-jsieve-0.3-SNAPSHOT.jar?rev=722841&r1=722840&r2=722841&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/server/trunk/stage/org.apache.james/jars/apache-jsieve-mailet-0.3-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/james/server/trunk/stage/org.apache.james/jars/apache-jsieve-mailet-0.3-SNAPSHOT.jar?rev=722841&r1=722840&r2=722841&view=diff
==============================================================================
Binary files - no diff available.



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