PROTOCOLS-68 Manage Sieve should be located in protocol library and in server/mailet

git-svn-id: https://svn.apache.org/repos/asf/james/jsieve/trunk@1716458 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/manager/api/pom.xml b/manager/api/pom.xml
deleted file mode 100644
index 53cd5c2..0000000
--- a/manager/api/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>apache-jsieve-manager</artifactId>
-        <relativePath>..</relativePath>
-        <version>0.6-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>apache-jsieve-manager-api</artifactId>
-    <packaging>bundle</packaging>
-    <name>Apache James :: jSieve :: Manager API</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>james-server-data-api</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/ArgumentException.java b/manager/api/src/main/java/org/apache/james/managesieve/api/ArgumentException.java
deleted file mode 100644
index f0cead2..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/ArgumentException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *   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.managesieve.api;
-
-/**
- * <code>ArgumentException</code>
- */
-public class ArgumentException extends ManageSieveException {
-
-    private static final long serialVersionUID = -7407426714052613820L;
-
-    /**
-     * Creates a new instance of ArgumentException.
-     *
-     */
-    public ArgumentException() {
-    }
-
-    /**
-     * Creates a new instance of ArgumentException.
-     *
-     * @param message
-     * @param cause
-     */
-    public ArgumentException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Creates a new instance of ArgumentException.
-     *
-     * @param message
-     */
-    public ArgumentException(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new instance of ArgumentException.
-     *
-     * @param cause
-     */
-    public ArgumentException(Throwable cause) {
-        super(cause);
-    }
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/AuthenticationException.java b/manager/api/src/main/java/org/apache/james/managesieve/api/AuthenticationException.java
deleted file mode 100644
index 14a6d3f..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/AuthenticationException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *   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.managesieve.api;
-
-public class AuthenticationException extends ManageSieveException
-{
-    private static final long serialVersionUID = -7564649071256099047L;
-}
\ No newline at end of file
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/AuthenticationRequiredException.java b/manager/api/src/main/java/org/apache/james/managesieve/api/AuthenticationRequiredException.java
deleted file mode 100644
index a333def..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/AuthenticationRequiredException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *   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.managesieve.api;
-
-public class AuthenticationRequiredException extends ManageSieveException
-{
-    private static final long serialVersionUID = 4992598322874189613L;  
-}
\ No newline at end of file
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/ConfigurationError.java b/manager/api/src/main/java/org/apache/james/managesieve/api/ConfigurationError.java
deleted file mode 100644
index 7f76f1c..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/ConfigurationError.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *   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.managesieve.api;
-
-/**
- * <code>ConfigurationError</code>
- */
-public class ConfigurationError extends ManageSieveError {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 5350261185844873258L;
-
-    /**
-     * Creates a new instance of ConfigurationError.
-     *
-     */
-    public ConfigurationError() {
-    }
-
-    /**
-     * Creates a new instance of ConfigurationError.
-     *
-     * @param message
-     */
-    public ConfigurationError(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new instance of ConfigurationError.
-     *
-     * @param cause
-     */
-    public ConfigurationError(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Creates a new instance of ConfigurationError.
-     *
-     * @param message
-     * @param cause
-     */
-    public ConfigurationError(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveError.java b/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveError.java
deleted file mode 100644
index 1ab0c84..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveError.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *   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.managesieve.api;
-
-/**
- * <code>ManageSieveError</code>
- */
-public class ManageSieveError extends Error {
-
-    private static final long serialVersionUID = 1488887751782386767L;
-
-    /**
-     * Creates a new instance of ManageSieveError.
-     *
-     */
-    public ManageSieveError() {
-    }
-
-    /**
-     * Creates a new instance of ManageSieveError.
-     *
-     * @param message
-     */
-    public ManageSieveError(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new instance of ManageSieveError.
-     *
-     * @param cause
-     */
-    public ManageSieveError(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Creates a new instance of ManageSieveError.
-     *
-     * @param message
-     * @param cause
-     */
-    public ManageSieveError(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java b/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java
deleted file mode 100644
index a583d59..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *   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.managesieve.api;
-
-public class ManageSieveException extends Exception
-{
-    /**
-     * Creates a new instance of ManageSieveException.
-     *
-     */
-    public ManageSieveException() {
-        super();
-    }
-
-    /**
-     * Creates a new instance of ManageSieveException.
-     *
-     * @param message
-     * @param cause
-     */
-    public ManageSieveException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Creates a new instance of ManageSieveException.
-     *
-     * @param message
-     */
-    public ManageSieveException(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new instance of ManageSieveException.
-     *
-     * @param cause
-     */
-    public ManageSieveException(Throwable cause) {
-        super(cause);
-    }
-
-    private static final long serialVersionUID = -1446993382609775076L;        
-}
\ No newline at end of file
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveRuntimeException.java b/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveRuntimeException.java
deleted file mode 100644
index 2b59e25..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/ManageSieveRuntimeException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *   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.managesieve.api;
-
-/**
- * <code>ManageSieveRuntimeException</code>
- */
-public class ManageSieveRuntimeException extends RuntimeException {
-
-    private static final long serialVersionUID = 6344283243541187693L;
-
-    /**
-     * Creates a new instance of ManageSieveRuntimeException.
-     *
-     */
-    public ManageSieveRuntimeException() {
-    }
-
-    /**
-     * Creates a new instance of ManageSieveRuntimeException.
-     *
-     * @param message
-     */
-    public ManageSieveRuntimeException(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new instance of ManageSieveRuntimeException.
-     *
-     * @param cause
-     */
-    public ManageSieveRuntimeException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Creates a new instance of ManageSieveRuntimeException.
-     *
-     * @param message
-     * @param cause
-     */
-    public ManageSieveRuntimeException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/Session.java b/manager/api/src/main/java/org/apache/james/managesieve/api/Session.java
deleted file mode 100644
index cf18cb9..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/Session.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *   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.managesieve.api;
-
-/**
- * <code>Session</code>
- */
-public interface Session {
-    
-    public interface UserListener
-    {
-        abstract public void notifyChange(String user);
-    }
-    
-    abstract public String getUser();
-    
-    abstract public void addUserListener(UserListener listener);
-    
-    abstract public void removeUserListener(UserListener listener);
-    
-    public interface AuthenticationListener
-    {
-        abstract public void notifyChange(boolean isAuthenticated);
-    }
-    
-    abstract public boolean isAuthenticated();
-    
-    abstract public void addAuthenticationListener(AuthenticationListener listener);
-    
-    abstract public void removeAuthenticationListener(AuthenticationListener listener);
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/SieveParser.java b/manager/api/src/main/java/org/apache/james/managesieve/api/SieveParser.java
deleted file mode 100644
index 618e9f1..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/SieveParser.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *   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.managesieve.api;
-
-import java.util.List;
-
-
-/**
- * <code>SieveParser</code>
- */
-public interface SieveParser {
-    
-    abstract List<String> parse(String content) throws SyntaxException;
-    
-    abstract List<String> getExtensions();
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/SyntaxException.java b/manager/api/src/main/java/org/apache/james/managesieve/api/SyntaxException.java
deleted file mode 100644
index 0f57cc0..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/SyntaxException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *   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.managesieve.api;
-
-public class SyntaxException extends ManageSieveException
-{
-    private static final long serialVersionUID = 2336683565743503262L;
-    
-    /**
-     * Creates a new instance of SyntaxException.
-     *
-     */
-    public SyntaxException() {
-        super();
-    }
-
-    /**
-     * Creates a new instance of SyntaxException.
-     *
-     * @param message
-     * @param cause
-     */
-    public SyntaxException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Creates a new instance of SyntaxException.
-     *
-     * @param message
-     */
-    public SyntaxException(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new instance of SyntaxException.
-     *
-     * @param cause
-     */
-    public SyntaxException(Throwable cause) {
-        super(cause);
-    }
-
-}
\ No newline at end of file
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Authenticate.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Authenticate.java
deleted file mode 100644
index 30a6d5e..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Authenticate.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationException;
-
-
-/**
- * <code>Authenticate</code>
- * 
- * @see <a href=http://tools.ietf.org/html/rfc5804#section-2.1>RFC 5804 AUTHENTICATE Command</a>
- * 
- */
-public interface Authenticate {
-    
-    abstract public void authenticate(String mechanism) throws AuthenticationException;
-    
-    abstract public void authenticate(String mechanism, String initialData) throws AuthenticationException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Capability.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Capability.java
deleted file mode 100644
index 178a53a..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Capability.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import java.util.Map;
-
-/**
- * <code>Capability</code>
- */
-public interface Capability {
-
-    abstract public Map<Capabilities, String> capability();
-
-    /**
-     * <code>Capabilities</code>
-     * 
-     *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.4>RFC 5804 CAPABILITY Command</a>
-     */
-    public enum Capabilities {
-        IMPLEMENTATION,
-        SASL,
-        SIEVE,
-        STARTTLS,
-        MAXREDIRECTS,
-        NOTIFY,
-        LANGUAGE,
-        OWNER,
-        VERSION,
-        UNAUTHENTICATE,
-        GETACTIVE
-    }
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/CheckScript.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/CheckScript.java
deleted file mode 100644
index 19eb711..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/CheckScript.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import java.util.List;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.managesieve.api.SyntaxException;
-
-/**
- * <code>CheckScript</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.12>RFC 5804 CHECKSCRIPT Command</a>
- */
-public interface CheckScript {
-    
-    abstract public List<String> checkScript(String content) throws AuthenticationRequiredException, SyntaxException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/CoreCommands.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/CoreCommands.java
deleted file mode 100644
index 2d3006b..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/CoreCommands.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-/**
- * <code>CoreCommands</code>
- * 
- * <p>Core RFC 5804 Commands common to all transports
- * 
- * @see <a href=http://tools.ietf.org/html/rfc5804#section-2>RFC 5804 Commands</a>
- */
-public interface CoreCommands extends Capability, CheckScript, DeleteScript, GetScript, HaveSpace,
-        ListScripts, PutScript, RenameScript, SetActive, GetActive {
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/DeleteScript.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/DeleteScript.java
deleted file mode 100644
index e4d9b08..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/DeleteScript.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.exception.IsActiveException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-
-/**
- * <code>DeleteScript</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.10>RFC 5804 DELETESCRIPT Command</a>
- */
-public interface DeleteScript {
-    
-    abstract public void deleteScript(String name) throws AuthenticationRequiredException, ScriptNotFoundException, IsActiveException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/GetActive.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/GetActive.java
deleted file mode 100644
index 7bc5d34..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/GetActive.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.exception.StorageException;
-
-/**
- * <code>GetScript</code> is an extension to the commands defined by RFC 5804. It provides a means
- * of retrieving a user's currently active script in a single call. The alternative using RFC 5804
- * mandated commands is to call ListScripts, parse the result to identify the active script and 
- * call GetScript to retrieve it. 
- */
-public interface GetActive {
-    
-    abstract public String getActive() throws AuthenticationRequiredException, ScriptNotFoundException, StorageException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/GetScript.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/GetScript.java
deleted file mode 100644
index 5d8a7cd..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/GetScript.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.exception.StorageException;
-
-/**
- * <code>GetScript</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.9>RFC 5804 GETSCRIPT Command</a>
- */
-public interface GetScript {
-    
-    abstract public String getScript(String name) throws AuthenticationRequiredException, ScriptNotFoundException, StorageException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/HaveSpace.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/HaveSpace.java
deleted file mode 100644
index c4a6459..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/HaveSpace.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-
-/**
- * <code>HaveSpace</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.5>RFC 5804 HAVESPACE Command</a>
- */
-public interface HaveSpace {
-    
-    abstract public void haveSpace(String name, long size) throws AuthenticationRequiredException, QuotaExceededException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/LineCommands.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/LineCommands.java
deleted file mode 100644
index 9d4e463..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/LineCommands.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-/**
- * <code>LineCommands</code>
- * 
- * <p>Commands specific to the line oriented protocol defined by RFC 5804
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-1.8>RFC 5804 Transport</a>
- */
-public interface LineCommands extends Authenticate, Unauthenticate, Logout, Noop {
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/ListScripts.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/ListScripts.java
deleted file mode 100644
index 8bc26c1..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/ListScripts.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import java.util.List;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.ScriptSummary;
-
-/**
- * <code>ListScripts</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.7>RFC 5804 LISTSCRIPTS Command</a>
- */
-public interface ListScripts {
-       
-    abstract public List<ScriptSummary> listScripts() throws AuthenticationRequiredException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Logout.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Logout.java
deleted file mode 100644
index 6b1a136..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Logout.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-
-/**
- * <code>Logout</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.3>RFC 5804 LOGOUT Command</a>
- */
-public interface Logout {
-    
-    abstract public void logout();
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Noop.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Noop.java
deleted file mode 100644
index 6b5c022..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Noop.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-
-/**
- * <code>Noop</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.13>RFC 5804 NOOP Command</a>
- */
-public interface Noop {
-    
-    abstract public void noop();
-    
-    abstract public String noop(String tag);
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/PutScript.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/PutScript.java
deleted file mode 100644
index 8f55abc..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/PutScript.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import java.util.List;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.managesieve.api.SyntaxException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-
-/**
- * <code>PutScript</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.6>RFC 5804 PUTSCRIPT Command</a>
- */
-public interface PutScript {
-    
-    abstract public List<String> putScript(String name, String content) throws AuthenticationRequiredException, SyntaxException, QuotaExceededException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/RenameScript.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/RenameScript.java
deleted file mode 100644
index 6b61694..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/RenameScript.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.exception.DuplicateException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-
-/**
- * <code>RenameScript</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.11>RFC 5804 RENAMESCRIPT Command</a>
- */
-public interface RenameScript {
-   
-    abstract public void renameScript(String oldName, String newName) throws AuthenticationRequiredException, ScriptNotFoundException, DuplicateException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/SetActive.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/SetActive.java
deleted file mode 100644
index 59c1048..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/SetActive.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-
-/**
- * <code>SetActive</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.8>RFC 5804 SETACTIVE Command</a>
- */
-public interface SetActive {
-    
-    abstract public void setActive(String name) throws AuthenticationRequiredException, ScriptNotFoundException;
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/StartTLS.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/StartTLS.java
deleted file mode 100644
index 33776fc..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/StartTLS.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-/**
- * <code>StartTLS</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.2>RFC 5804 STARTTLS Command</a>
- */
-public interface StartTLS {
-    
-    abstract public void startTLS();
-
-}
diff --git a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Unauthenticate.java b/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Unauthenticate.java
deleted file mode 100644
index 6822b6a..0000000
--- a/manager/api/src/main/java/org/apache/james/managesieve/api/commands/Unauthenticate.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *   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.managesieve.api.commands;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-
-
-/**
- * <code>Unauthenticate</code>
- * 
- *  @see <a href=http://tools.ietf.org/html/rfc5804#section-2.14.1>RFC 5804 UNAUTHENTICATE Command</a>
- */
-public interface Unauthenticate {
-   
-    abstract public void unauthenticate() throws AuthenticationRequiredException;
-
-}
diff --git a/manager/core/pom.xml b/manager/core/pom.xml
deleted file mode 100644
index 7feacc7..0000000
--- a/manager/core/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>apache-jsieve-manager</artifactId>
-        <version>0.6-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-    <artifactId>apache-jsieve-manager-core</artifactId>
-    <packaging>bundle</packaging>
-    <name>Apache James :: jSieve :: Manager Core</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-jsieve-manager-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-jsieve-manager-mock</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>james-server-data-api</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/manager/core/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java b/manager/core/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java
deleted file mode 100644
index 044fa47..0000000
--- a/manager/core/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- *   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.managesieve.core;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.managesieve.api.ManageSieveRuntimeException;
-import org.apache.james.managesieve.api.Session;
-import org.apache.james.managesieve.api.SieveParser;
-import org.apache.james.managesieve.api.SyntaxException;
-import org.apache.james.managesieve.api.Session.UserListener;
-import org.apache.james.managesieve.api.commands.CoreCommands;
-import org.apache.james.sieverepository.api.exception.DuplicateException;
-import org.apache.james.sieverepository.api.exception.DuplicateUserException;
-import org.apache.james.sieverepository.api.exception.IsActiveException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.ScriptSummary;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.sieverepository.api.exception.SieveRepositoryException;
-import org.apache.james.sieverepository.api.exception.StorageException;
-import org.apache.james.sieverepository.api.exception.UserNotFoundException;
-
-/**
- * <code>CoreProcessor</code>
- */
-public class CoreProcessor implements CoreCommands {
-    
-    public static final String IMPLEMENTATION_DESCRIPTION = "Apache ManageSieve v1.0";
-    public static final String MANAGE_SIEVE_VERSION = "1.0";
-    
-    private SieveRepository _repository = null;
-    private Session _session = null;
-    private SieveParser _parser = null;
-
-    /**
-     * Creates a new instance of CoreProcessor.
-     *
-     */
-    private CoreProcessor() {
-        super();
-    }
-    
-    /**
-     * Creates a new instance of CoreProcessor.
-     *
-     */
-    public CoreProcessor(Session session, SieveRepository repository, SieveParser parser) {
-        this();
-        _session = session;
-        _repository = repository;
-        _parser = parser;
-
-        // Ensure the session user is defined in the repository
-        _session.addUserListener(new UserListener() {
-
-            public void notifyChange(String user) {
-                ensureUser(user);
-            }
-        });
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.Capability#capability()
-     */
-    public Map<Capabilities, String> capability() {
-        Map<Capabilities, String> capabilities = new HashMap<Capabilities, String>();
-        capabilities.put(Capabilities.IMPLEMENTATION, IMPLEMENTATION_DESCRIPTION);
-        capabilities.put(Capabilities.VERSION, MANAGE_SIEVE_VERSION);
-        StringBuilder builder = new StringBuilder();
-        for (String extension : _parser.getExtensions())
-        {
-            builder.append(extension).append(' ');
-        }
-        String extensions = builder.toString().trim();
-        if (!extensions.isEmpty())
-        {
-            capabilities.put(Capabilities.SIEVE, extensions);
-        }
-        if (isAuthenticated())
-        {
-            capabilities.put(Capabilities.OWNER, getUser());
-        }
-        capabilities.put(Capabilities.GETACTIVE, null);
-        return capabilities;
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.CheckScript#checkScript(java.lang.String)
-     */
-    public List<String> checkScript(String content) throws AuthenticationRequiredException,
-            SyntaxException {
-        authenticationCheck();
-        return _parser.parse(content);
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.DeleteScript#deleteScript(java.lang.String)
-     */
-    public void deleteScript(String name) throws AuthenticationRequiredException,
-            ScriptNotFoundException, IsActiveException {
-        authenticationCheck();
-        try {
-            _repository.deleteScript(getUser(), name);
-        } catch (StorageException ex) {
-            throw new ManageSieveRuntimeException(ex);
-        } catch (UserNotFoundException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        }
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.GetScript#getScript(java.lang.String)
-     */
-    public String getScript(String name) throws AuthenticationRequiredException,
-        ScriptNotFoundException, StorageException {
-        authenticationCheck();
-        String script = null;
-        try {
-            script = _repository.getScript(getUser(), name);
-        } catch (UserNotFoundException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        }
-        return script;
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.HaveSpace#haveSpace(java.lang.String, long)
-     */
-    public void haveSpace(String name, long size) throws AuthenticationRequiredException,
-            QuotaExceededException {
-        authenticationCheck();
-        try {
-            _repository.haveSpace(getUser(), name, size);
-        } catch (SieveRepositoryException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        }
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.ListScripts#listScripts()
-     */
-    public List<ScriptSummary> listScripts() throws AuthenticationRequiredException {
-        authenticationCheck();
-        List<ScriptSummary> summaries = null;
-        try {
-            summaries = _repository.listScripts(getUser());
-        } catch (SieveRepositoryException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        }
-        return summaries;
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.PutScript#putScript(java.lang.String, java.lang.String)
-     */
-    public List<String> putScript(String name, String content)
-            throws AuthenticationRequiredException, SyntaxException, QuotaExceededException {
-        authenticationCheck();
-        List<String> warnings = _parser.parse(content);       
-        try {
-            _repository.putScript(getUser(), name, content);
-        } catch (UserNotFoundException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        } catch (StorageException ex) {
-            throw new ManageSieveRuntimeException(ex);
-        }
-        return warnings;
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.RenameScript#renameScript(java.lang.String, java.lang.String)
-     */
-    public void renameScript(String oldName, String newName)
-            throws AuthenticationRequiredException, ScriptNotFoundException,
-            DuplicateException {
-        authenticationCheck();
-        try {
-            _repository.renameScript(getUser(), oldName, newName);
-        } catch (UserNotFoundException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        } catch (StorageException ex) {
-            throw new ManageSieveRuntimeException(ex);
-        }
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.SetActive#setActive(java.lang.String)
-     */
-    public void setActive(String name) throws AuthenticationRequiredException,
-            ScriptNotFoundException {
-        authenticationCheck();
-        try {
-            _repository.setActive(getUser(), name);
-        } catch (UserNotFoundException ex) {
-            // Should not happen as the UserListener should ensure the session user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        } catch (StorageException ex) {
-            throw new ManageSieveRuntimeException(ex);
-        }
-    }   
-    
-    protected String getUser()
-    {
-        return _session.getUser();
-    }
-    
-    protected void ensureUser(String user) {
-        try {
-            if (!_repository.hasUser(user)) {
-                _repository.addUser(user);
-            }
-        } catch (SieveRepositoryException ex) {
-            throw new ManageSieveRuntimeException(ex);
-        }
-    }
-    
-    protected void authenticationCheck() throws AuthenticationRequiredException
-    {
-        if (!isAuthenticated())
-        {
-            throw new AuthenticationRequiredException();
-        }
-    }
-
-    protected boolean isAuthenticated()
-    {
-        return _session.isAuthenticated();
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.commands.GetActive#getActive()
-     */
-    public String getActive() throws AuthenticationRequiredException, ScriptNotFoundException, StorageException {
-        authenticationCheck();
-        
-        String script = null;
-        try {
-            script = _repository.getActive(getUser());
-        } catch (UserNotFoundException ex) {
-            // Should not happen as the UserListener should ensure the session
-            // user is defined in the repository
-            throw new ManageSieveRuntimeException(ex);
-        }
-        return script;
-    }
-
-}
diff --git a/manager/core/src/main/java/org/apache/james/managesieve/transcode/LineToCore.java b/manager/core/src/main/java/org/apache/james/managesieve/transcode/LineToCore.java
deleted file mode 100644
index 977b5e4..0000000
--- a/manager/core/src/main/java/org/apache/james/managesieve/transcode/LineToCore.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *   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.managesieve.transcode;
-
-import java.util.InputMismatchException;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Scanner;
-
-import org.apache.james.managesieve.api.ArgumentException;
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.managesieve.api.SyntaxException;
-import org.apache.james.managesieve.api.commands.CoreCommands;
-import org.apache.james.managesieve.api.commands.Capability.Capabilities;
-import org.apache.james.managesieve.util.ParserUtils;
-import org.apache.james.sieverepository.api.exception.DuplicateException;
-import org.apache.james.sieverepository.api.exception.IsActiveException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.ScriptSummary;
-import org.apache.james.sieverepository.api.exception.StorageException;
-
-/**
- * <code>LineToCore</code>
- */
-public class LineToCore{
-    
-    private CoreCommands _core = null;
-
-    /**
-     * Creates a new instance of LineToCore.
-     *
-     */
-    private LineToCore() {
-        super();
-    }
-    
-    /**
-     * Creates a new instance of LineToCore.
-     *
-     * @param core
-     */
-    public LineToCore(CoreCommands core) {
-        this();
-        _core = core;
-    }
-    
-    public Map<Capabilities, String> capability(String args) throws ArgumentException
-    {
-        if (!args.trim().isEmpty())
-        {
-            throw new ArgumentException("Too many arguments: " + args);
-        }
-        return _core.capability();
-    }
-    
-    public void deleteScript(String args) throws AuthenticationRequiredException, ScriptNotFoundException, IsActiveException, ArgumentException
-    {       
-        String scriptName = ParserUtils.getScriptName(args);
-        if (null == scriptName || scriptName.isEmpty())
-        {
-            throw new ArgumentException("Missing argument: script name");
-        }
-        
-        Scanner scanner = new Scanner(args.substring(scriptName.length()).trim()).useDelimiter("\\A");
-        if (scanner.hasNext())
-        {
-            throw new ArgumentException("Too many arguments: " + scanner.next());
-        }
-        _core.deleteScript(ParserUtils.unquote(scriptName));
-    }    
-    
-    public String getScript(String args) throws AuthenticationRequiredException, ScriptNotFoundException, ArgumentException, StorageException {
-        String scriptName = ParserUtils.getScriptName(args);
-        if (null == scriptName || scriptName.isEmpty())
-        {
-            throw new ArgumentException("Missing argument: script name");
-        }
-        Scanner scanner = new Scanner(args.substring(scriptName.length()).trim()).useDelimiter("\\A");
-        if (scanner.hasNext())
-        {
-            throw new ArgumentException("Too many arguments: " + scanner.next());
-        }
-        return _core.getScript(ParserUtils.unquote(scriptName));
-    }     
-    
-    public List<String> checkScript(String args) throws ArgumentException, AuthenticationRequiredException, SyntaxException
-    {
-        if (args.trim().isEmpty())
-        {
-            throw new ArgumentException("Missing argument: script content");
-        }
-        return _core.checkScript(args);
-    }
-
-    public void haveSpace(String args) throws AuthenticationRequiredException,
-            QuotaExceededException, ArgumentException {
-        String scriptName = ParserUtils.getScriptName(args);
-        if (null == scriptName || scriptName.isEmpty()) {
-            throw new ArgumentException("Missing argument: script name");
-        }
-
-        Scanner scanner = new Scanner(args.substring(scriptName.length()).trim());
-        long size = 0;
-
-        try {
-            size = scanner.nextLong();
-        } catch (InputMismatchException ex) {
-            throw new ArgumentException("Invalid argument: script size");
-        } catch (NoSuchElementException ex) {
-            throw new ArgumentException("Missing argument: script size");
-        }
-
-        scanner.useDelimiter("\\A");
-        if (scanner.hasNext()) {
-            throw new ArgumentException("Too many arguments: " + scanner.next().trim());
-        }
-        _core.haveSpace(ParserUtils.unquote(scriptName), size);
-    }
-
-    public List<ScriptSummary> listScripts(String args) throws AuthenticationRequiredException, ArgumentException {
-        if (!args.trim().isEmpty())
-        {
-            throw new ArgumentException("Too many arguments: " + args);
-        }
-        return _core.listScripts();
-    }
-
-    public List<String> putScript(String args)
-            throws AuthenticationRequiredException, SyntaxException, QuotaExceededException, ArgumentException {
-        String scriptName = ParserUtils.getScriptName(args);
-        if (null == scriptName || scriptName.isEmpty())
-        {
-            throw new ArgumentException("Missing argument: script name");
-        }
-        Scanner scanner = new Scanner(args.substring(scriptName.length()).trim()).useDelimiter("\\A");
-        if (!scanner.hasNext())
-        {
-            throw new ArgumentException("Missing argument: script content");
-        }
-        String content = scanner.next();
-        return _core.putScript(ParserUtils.unquote(scriptName), content);
-    }
-
-    public void renameScript(String args)
-            throws AuthenticationRequiredException, ScriptNotFoundException,
-            DuplicateException, ArgumentException {
-        String oldName = ParserUtils.getScriptName(args);
-        if (null == oldName || oldName.isEmpty())
-        {
-            throw new ArgumentException("Missing argument: old script name");
-        }
-        
-        String newName = ParserUtils.getScriptName(args.substring(oldName.length()));
-        if (null == newName || newName.isEmpty())
-        {
-            throw new ArgumentException("Missing argument: new script name");
-        } 
-        
-        Scanner scanner = new Scanner(args.substring(oldName.length() + 1 + newName.length()).trim()).useDelimiter("\\A");
-        if (scanner.hasNext())
-        {
-            throw new ArgumentException("Too many arguments: " + scanner.next());
-        }
-        _core.renameScript(oldName, newName);    
-    }
-
-    public void setActive(String args) throws AuthenticationRequiredException,
-            ScriptNotFoundException, ArgumentException {
-        String scriptName = ParserUtils.getScriptName(args);
-        if (null == scriptName || scriptName.isEmpty())
-        {
-            throw new ArgumentException("Missing argument: script name");
-        }
-        
-        Scanner scanner = new Scanner(args.substring(scriptName.length()).trim()).useDelimiter("\\A");
-        if (scanner.hasNext())
-        {
-            throw new ArgumentException("Too many arguments: " + scanner.next());
-        }
-        _core.setActive(ParserUtils.unquote(scriptName));
-    } 
-    
-    public String getActive(String args) throws AuthenticationRequiredException, ScriptNotFoundException, ArgumentException, StorageException {
-        Scanner scanner = new Scanner(args.trim()).useDelimiter("\\A");
-        if (scanner.hasNext())
-        {
-            throw new ArgumentException("Too many arguments: " + scanner.next());
-        }
-        return _core.getActive();
-    }  
-
-}
diff --git a/manager/core/src/main/java/org/apache/james/managesieve/transcode/LineToCoreToLine.java b/manager/core/src/main/java/org/apache/james/managesieve/transcode/LineToCoreToLine.java
deleted file mode 100644
index 8b8217e..0000000
--- a/manager/core/src/main/java/org/apache/james/managesieve/transcode/LineToCoreToLine.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- *   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.managesieve.transcode;
-
-import java.util.List;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.apache.james.managesieve.api.ArgumentException;
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.managesieve.api.SyntaxException;
-import org.apache.james.managesieve.api.commands.Capability.Capabilities;
-import org.apache.james.sieverepository.api.exception.DuplicateException;
-import org.apache.james.sieverepository.api.exception.IsActiveException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.ScriptSummary;
-import org.apache.james.sieverepository.api.exception.StorageException;
-
-/**
- * <code>LineToCoreToLine</code>
- */
-public class LineToCoreToLine {
-    
-    private LineToCore _lineToCore = null;
-
-    /**
-     * Creates a new instance of LineToCoreToLine.
-     *
-     */
-    private LineToCoreToLine() {
-        super();
-    }
-    
-    public LineToCoreToLine(LineToCore lineToCore) {
-        this();
-        _lineToCore = lineToCore;
-    }    
-
-    public String capability(String args) {       
-        Set<Entry<Capabilities, String>> entries = null;
-        try {
-            entries =_lineToCore.capability(args).entrySet(); 
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        
-        StringBuilder builder = new StringBuilder();
-        for (Entry<Capabilities, String> entry : entries)
-        {
-            builder
-                .append(entry.getKey().toString())
-                .append(' ')
-                .append(null == entry.getValue() ? "" : entry.getValue())
-                .append("\r\n");
-        }
-        builder.append("OK");
-        return builder.toString();
-    }
-
-    public String checkScript(String args) {
-        List<String> warnings = null;
-        try {
-            warnings = _lineToCore.checkScript(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        } catch (SyntaxException ex) {
-            return "NO \"Syntax Error: " + ex.getMessage() + "\"";
-        }
-
-        StringBuilder builder = new StringBuilder();
-        if (!warnings.isEmpty()) {
-            builder.append("OK (WARNINGS)");
-            for (String warning : warnings) {
-                builder
-                .append(" \"")
-                .append(warning)
-                .append('"');
-            }
-        } else {
-            builder.append("OK");
-        }
-        return builder.toString();
-    }
-
-    public String deleteScript(String args) {
-        try {
-            _lineToCore.deleteScript(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ScriptNotFoundException ex) {
-            return "NO (NONEXISTENT) \"There is no script by that name\"";
-        } catch (IsActiveException ex) {
-            return "NO (ACTIVE) \"You may not delete an active script\"";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        return "OK";
-    }
-
-    public String getScript(String args) {
-        String content = null;
-        try {
-            content = _lineToCore.getScript(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ScriptNotFoundException ex) {
-            return "NO (NONEXISTENT) \"There is no script by that name\"";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        } catch (StorageException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        StringBuilder builder = new StringBuilder(content);
-        builder
-            .append("\r\n")
-            .append("OK");
-        return builder.toString();
-    }
-
-    public String haveSpace(String args) {
-        try {
-            _lineToCore.haveSpace(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (QuotaExceededException ex) {
-            return "NO (QUOTA/MAXSIZE) \"Quota exceeded\"";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        return "OK";
-    }
-
-    public String listScripts(String args) {
-        List<ScriptSummary> summaries = null;
-        try {
-            summaries = _lineToCore.listScripts(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        StringBuilder builder = new StringBuilder();
-        for (ScriptSummary summary : summaries)
-        {
-            builder
-                .append('"')
-                .append(summary.getName())
-                .append('"');
-            if (summary.isActive())
-            {
-                builder
-                    .append(' ')
-                    .append("ACTIVE");
-            }
-            builder
-                .append("\r\n");
-        }
-        builder.append("OK");
-        return builder.toString();
-    }
-
-    public String putScript(String args) {
-        List<String> warnings = null;
-        try {
-            warnings = _lineToCore.putScript(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (SyntaxException ex) {
-            return "NO \"Syntax Error: " + ex.getMessage() + "\"";
-        } catch (QuotaExceededException ex) {
-            return "NO (QUOTA/MAXSIZE) \"Quota exceeded\"";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        StringBuilder builder = new StringBuilder();
-        if (!warnings.isEmpty()) {
-            builder.append("OK (WARNINGS)");
-            for (String warning : warnings) {
-                builder
-                    .append(" \"")
-                    .append(warning)
-                    .append('"');
-            }
-        } else {
-            builder.append("OK");
-        }
-        return builder.toString();
-    }
-
-    public String renameScript(String args) {
-        try {
-            _lineToCore.renameScript(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ScriptNotFoundException ex) {
-            return "NO (NONEXISTENT) \"There is no script by that name\"";
-        }  catch (DuplicateException ex) {
-            return "NO (ALREADYEXISTS) \"A script with that name already exists\"";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-    return "OK";
-    }
-
-    public String setActive(String args) {
-        try {
-            _lineToCore.setActive(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ScriptNotFoundException ex) {
-            return "NO (NONEXISTENT) \"There is no script by that name\"";
-        }  catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        return "OK";
-    }
-    
-    public String getActive(String args) {
-        String content = null;
-        try {
-            content = _lineToCore.getActive(args);
-        } catch (AuthenticationRequiredException ex) {
-            return "NO";
-        } catch (ScriptNotFoundException ex) {
-            return "NO (NONEXISTENT) \"" + ex.getMessage() + "\"";
-        } catch (ArgumentException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        } catch (StorageException ex) {
-            return "NO \"" + ex.getMessage() + "\"";
-        }
-        StringBuilder builder = new StringBuilder(content);
-        builder
-            .append("\r\n")
-            .append("OK");
-        return builder.toString();
-    }
-
-}
diff --git a/manager/core/src/main/java/org/apache/james/managesieve/util/ParserUtils.java b/manager/core/src/main/java/org/apache/james/managesieve/util/ParserUtils.java
deleted file mode 100644
index 1c8f0bf..0000000
--- a/manager/core/src/main/java/org/apache/james/managesieve/util/ParserUtils.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *   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.managesieve.util;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * <code>ParserUtils</code>
- */
-public class ParserUtils {
-
-    private static final Pattern SCRIPT_NAME_REGEX = Pattern.compile("[^\\s\"']+|\"[^\"]*\"|'[^']*'");
-
-    public static String getScriptName(String args) {
-        Matcher regexMatcher = SCRIPT_NAME_REGEX.matcher(args);
-        regexMatcher.find();
-        String name = null;
-        try {
-        name = regexMatcher.group();
-        } catch(IllegalStateException ex)
-        {
-            // no op
-        }
-        return name;
-    }
-
-    public static String unquote(String quoted) {
-        String result = quoted;
-        if (quoted.startsWith("\"") && quoted.endsWith("\"")) {
-            result = quoted.substring(1, quoted.length() - 1);
-        } else if (quoted.startsWith("'") && quoted.endsWith("'")) {
-            result = quoted.substring(1, quoted.length() - 1);
-        }
-        return result;
-    }
-
-}
diff --git a/manager/core/src/main/java/org/apache/james/managesieve/util/SettableSession.java b/manager/core/src/main/java/org/apache/james/managesieve/util/SettableSession.java
deleted file mode 100644
index 580b166..0000000
--- a/manager/core/src/main/java/org/apache/james/managesieve/util/SettableSession.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *   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.managesieve.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.james.managesieve.api.Session;
-
-/**
- * <code>SettableSession</code>
- */
-public class SettableSession implements Session {
-
-    String _user = null;
-    boolean _isAuthenticated = false;
-    List<UserListener> _userListeners = new ArrayList<UserListener>();
-    List<AuthenticationListener> _authenticationListeners = new ArrayList<AuthenticationListener>(); 
-    
-    /**
-     * @see org.apache.james.managesieve.api.Session#addAuthenticationListener(org.apache.james.managesieve.api.Session.AuthenticationListener)
-     */
-    public void addAuthenticationListener(AuthenticationListener listener) {
-        _authenticationListeners.add(listener);
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.Session#addUserListener(org.apache.james.managesieve.api.Session.UserListener)
-     */
-    public void addUserListener(UserListener listener) {
-        _userListeners.add(listener);            
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.Session#getUser()
-     */
-    public String getUser() {
-        return _user;
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.Session#isAuthenticated()
-     */
-    public boolean isAuthenticated() {
-        return _isAuthenticated;
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.Session#removeAuthenticationListener(org.apache.james.managesieve.api.Session.AuthenticationListener)
-     */
-    public void removeAuthenticationListener(AuthenticationListener listener) {
-        _authenticationListeners.remove(listener);
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.Session#removeUserListener(org.apache.james.managesieve.api.Session.UserListener)
-     */
-    public void removeUserListener(UserListener listener) {
-        _userListeners.remove(listener);       
-    }
-    
-    public void setAuthentication(boolean isAuthenticated) {
-        _isAuthenticated = isAuthenticated;
-        for(AuthenticationListener listener : _authenticationListeners)
-        {                  
-            listener.notifyChange(isAuthenticated);
-        }                
-    }
-
-    public void setUser(String user) {
-        _user = user;
-        for(UserListener listener : _userListeners)
-        {                  
-            listener.notifyChange(user);
-        }
-    }
-
-}
diff --git a/manager/core/src/test/java/org/apache/james/managesieve/core/CoreProcessorTestCase.java b/manager/core/src/test/java/org/apache/james/managesieve/core/CoreProcessorTestCase.java
deleted file mode 100644
index 4d9da8e..0000000
--- a/manager/core/src/test/java/org/apache/james/managesieve/core/CoreProcessorTestCase.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- *   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.managesieve.core;
-
-import org.apache.james.managesieve.api.AuthenticationRequiredException;
-import org.apache.james.managesieve.api.SyntaxException;
-import org.apache.james.managesieve.api.commands.Capability.Capabilities;
-import org.apache.james.managesieve.mock.MockSession;
-import org.apache.james.managesieve.mock.MockSieveParser;
-import org.apache.james.managesieve.mock.MockSieveRepository;
-import org.apache.james.sieverepository.api.exception.IsActiveException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.ScriptSummary;
-import org.apache.james.sieverepository.api.exception.StorageException;
-import org.apache.james.sieverepository.api.exception.UserNotFoundException;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
-
-/**
- * <code>CoreProcessorTestCase</code>
- */
-public class CoreProcessorTestCase {
-
-    private MockSession session;
-    private MockSieveParser parser;
-    private MockSieveRepository repository;
-    private CoreProcessor core;
-
-    @Before
-    public void setUp() throws Exception {
-        session = new MockSession();
-        parser = new MockSieveParser();
-        repository = new MockSieveRepository();
-        core = new CoreProcessor(session, repository, parser);
-    }
-
-    @Test
-    public final void testCapability() {
-        // Unauthenticated
-        session.setAuthentication(false);
-        parser.setExtensions(Arrays.asList("a", "b", "c"));
-        Map<Capabilities, String> capabilities = core.capability();
-        assertEquals(CoreProcessor.IMPLEMENTATION_DESCRIPTION, capabilities.get(Capabilities.IMPLEMENTATION));
-        assertEquals(CoreProcessor.MANAGE_SIEVE_VERSION, capabilities.get(Capabilities.VERSION));
-        assertEquals("a b c", capabilities.get(Capabilities.SIEVE));
-        assertFalse(capabilities.containsKey(Capabilities.OWNER));
-        assertTrue(capabilities.containsKey(Capabilities.GETACTIVE));
-
-        // Authenticated
-        session.setAuthentication(true);
-        parser.setExtensions(Arrays.asList("a", "b", "c"));
-        session.setUser("test");
-        capabilities = core.capability();
-        assertEquals(CoreProcessor.IMPLEMENTATION_DESCRIPTION, capabilities.get(Capabilities.IMPLEMENTATION));
-        assertEquals(CoreProcessor.MANAGE_SIEVE_VERSION, capabilities.get(Capabilities.VERSION));
-        assertEquals("a b c", capabilities.get(Capabilities.SIEVE));
-        assertEquals("test", capabilities.get(Capabilities.OWNER));
-        assertTrue(capabilities.containsKey(Capabilities.GETACTIVE));
-    }
-
-    @Test
-    public final void testCheckScript() throws AuthenticationRequiredException, SyntaxException {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.checkScript("warning");
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised
-        session.setAuthentication(true);
-        session.setUser("test");
-        List<String> warnings = core.checkScript("warning");
-        assertEquals(2, warnings.size());
-        assertEquals("warning1", warnings.get(0));
-        assertEquals("warning2", warnings.get(1));
-
-        // Syntax
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        try {
-            core.checkScript("SyntaxException");
-        } catch (SyntaxException ex) {
-            success = true;
-        }
-        assertTrue("Expected SyntaxException", success);
-    }
-
-    @Test
-    public final void testDeleteScript() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.deleteScript("script");
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised - non-existent script
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        try {
-            core.deleteScript("script");
-        } catch (ScriptNotFoundException ex) {
-            success = true;
-        }
-        assertTrue("Expected ScriptNotFoundException", success);
-
-        // Authorised - existent script
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "script", "content");
-        core.deleteScript("script");
-        success = false;
-        try {
-            repository.getScript("test", "script");
-        } catch (ScriptNotFoundException ex) {
-            success = true;
-        }
-        assertTrue("Expected ScriptNotFoundException", success);
-
-        // Authorised - active script
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "script", "content");
-        repository.setActive("test", "script");
-        try {
-            core.deleteScript("script");
-        } catch (IsActiveException ex) {
-            success = true;
-        }
-        assertTrue("Expected IsActiveException", success);
-    }
-
-    @Test
-    public final void testGetScript() throws ScriptNotFoundException, AuthenticationRequiredException, UserNotFoundException, StorageException, QuotaExceededException {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.getScript("script");
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised - non-existent script
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        try {
-            System.out.println("hello");
-            core.getScript("script");
-            System.out.println("yop yop");
-        } catch (ScriptNotFoundException ex) {
-            System.out.println("toto");
-            success = true;
-            ex.printStackTrace();
-        } catch (Exception e) {
-            System.out.println("Euh ... ");
-            e.printStackTrace();
-            System.out.println("Yolo");
-        }
-        assertTrue("Expected ScriptNotFoundException", success);
-
-        // Authorised - existent script
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "script", "content");
-        core.getScript("script");
-    }
-
-    @Test
-    public final void testHaveSpace() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.haveSpace("script", Long.MAX_VALUE);
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised - existent script
-        session.setAuthentication(true);
-        session.setUser("test");
-        core.haveSpace("script", Long.MAX_VALUE);
-    }
-
-    @Test
-    public final void testListScripts() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.listScripts();
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised - non-existent script
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        List<ScriptSummary> summaries = core.listScripts();
-        assertTrue(summaries.isEmpty());
-
-        // Authorised - existent script
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "script", "content");
-        summaries = core.listScripts();
-        assertEquals(1, summaries.size());
-    }
-
-    @Test
-    public final void testPutScript() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.putScript("script", "content");
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        core.putScript("script", "content");
-        assertEquals("content", repository.getScript("test", "script"));
-
-        // Syntax
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        try {
-            core.putScript("script", "SyntaxException");
-        } catch (SyntaxException ex) {
-            success = true;
-        }
-        assertTrue("Expected SyntaxException", success);
-    }
-
-    @Test
-    public final void testRenameScript() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.renameScript("oldName", "newName");
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "oldName", "content");
-        core.renameScript("oldName", "newName");
-        assertEquals("content", repository.getScript("test", "oldName"));
-    }
-
-    @Test
-    public final void testSetActive() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.setActive("script");
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "script", "content");
-        core.setActive("script");
-        assertEquals("content", repository.getActive("test"));
-    }
-
-    @Test
-    public final void testGetActive() throws Exception {
-        // Unauthorised
-        boolean success = false;
-        session.setAuthentication(false);
-        try {
-            core.getActive();
-        } catch (AuthenticationRequiredException ex) {
-            success = true;
-        }
-        assertTrue("Expected AuthenticationRequiredException", success);
-
-        // Authorised - non-existent script
-        success = false;
-        session.setAuthentication(true);
-        session.setUser("test");
-        try {
-            core.getActive();
-        } catch (ScriptNotFoundException ex) {
-            success = true;
-        }
-        assertTrue("Expected ScriptNotFoundException", success);
-
-        // Authorised - existent script, inactive
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.putScript("test", "script", "content");
-        try {
-            core.getActive();
-        } catch (ScriptNotFoundException ex) {
-            success = true;
-        }
-        assertTrue("Expected ScriptNotFoundException", success);
-
-        // Authorised - existent script, active
-        session.setAuthentication(true);
-        session.setUser("test");
-        repository.setActive("test", "script");
-        core.getActive();
-    }
-}
diff --git a/manager/jsieve/pom.xml b/manager/jsieve/pom.xml
deleted file mode 100644
index 39bbdee..0000000
--- a/manager/jsieve/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-  <!--
-    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.    
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-        <groupId>org.apache.james</groupId>
-		<artifactId>apache-jsieve-manager</artifactId>
-        <version>0.6-SNAPSHOT</version>
-		<relativePath>..</relativePath>
-	</parent>
-
-	<artifactId>apache-jsieve-manager-jsieve</artifactId>
-	<packaging>bundle</packaging>
-    <name>Apache James :: jSieve :: Manager jSieve</name>
-
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.james</groupId>
-			<artifactId>apache-jsieve-manager-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.james</groupId>
-			<artifactId>apache-jsieve-core</artifactId>
-		</dependency>
-	</dependencies>
-</project>
diff --git a/manager/jsieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java b/manager/jsieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java
deleted file mode 100644
index e44849f..0000000
--- a/manager/jsieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *   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.managesieve.jsieve;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-
-import org.apache.james.managesieve.api.SieveParser;
-import org.apache.james.managesieve.api.SyntaxException;
-import org.apache.jsieve.ConfigurationManager;
-import org.apache.jsieve.SieveFactory;
-import org.apache.jsieve.parser.generated.ParseException;
-
-/**
- * <code>Parser</code>
- */
-public class Parser implements SieveParser {
-    
-    private static final List<String> EMPTY_WARNINGS = new ArrayList<String>(0);
-    
-    private SieveFactory _sieveFactory = null;
-
-    /**
-     * Creates a new instance of Parser.
-     *
-     */
-    public Parser() {
-        super();
-    }
-    
-    /**
-     * Creates a new instance of Parser.
-     *
-     */
-    public Parser(ConfigurationManager manager) {
-        this();
-        setConfigurationManager(manager);
-    }
-    
-    /**
-     * setConfigurationManager.
-     *
-     * @param manager The <code>ConfigurationManager</code> to set
-     */
-    @Resource(name = "jsieveconfigurationmanager")
-    public void setConfigurationManager(ConfigurationManager manager) {
-        _sieveFactory = manager.build();
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.SieveParser#getExtensions()
-     */
-    public List<String> getExtensions() {
-        return _sieveFactory.getExtensions();
-    }
-
-    /**
-     * @see org.apache.james.managesieve.api.SieveParser#parse(java.lang.String)
-     */
-    public List<String> parse(String content) throws SyntaxException {
-        try {
-            _sieveFactory.parse(new ByteArrayInputStream(content.getBytes()));
-        } catch (ParseException ex) {
-            throw new SyntaxException(ex);
-        }
-        return EMPTY_WARNINGS;
-    }
-
-}
diff --git a/manager/mailet/pom.xml b/manager/mailet/pom.xml
deleted file mode 100644
index 30b04c6..0000000
--- a/manager/mailet/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-  <!--
-    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.    
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-        <groupId>org.apache.james</groupId>
-		<artifactId>apache-jsieve-manager</artifactId>
-        <version>0.6-SNAPSHOT</version>
-		<relativePath>..</relativePath>
-	</parent>
-
-	<artifactId>apache-jsieve-manager-mailet</artifactId>
-    <name>Apache James :: jSieve :: Manager Mailet</name>
-    <packaging>bundle</packaging>
-
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.james</groupId>
-			<artifactId>apache-jsieve-manager-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.james</groupId>
-			<artifactId>apache-mailet-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.james</groupId>
-			<artifactId>apache-mailet-base</artifactId>
-		</dependency>
-        <dependency>
-            <groupId>${javax.mail.groupId}</groupId>
-            <artifactId>${javax.mail.artifactId}</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${javax.activation.groupId}</groupId>
-            <artifactId>${javax.activation.artifactId}</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.inject</groupId>
-            <artifactId>javax.inject</artifactId>
-        </dependency>
-		<dependency>
-			<groupId>org.apache.james</groupId>
-			<artifactId>apache-jsieve-manager-mock</artifactId>
-			<scope>test</scope>
-		</dependency>
-	</dependencies>
-</project>
\ No newline at end of file
diff --git a/manager/mailet/src/main/java/org/apache/james/managesieve/mailet/ManageSieveMailet.java b/manager/mailet/src/main/java/org/apache/james/managesieve/mailet/ManageSieveMailet.java
deleted file mode 100644
index 4f40506..0000000
--- a/manager/mailet/src/main/java/org/apache/james/managesieve/mailet/ManageSieveMailet.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- *   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.managesieve.mailet;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Scanner;
-
-import javax.inject.Inject;
-import javax.mail.MessagingException;
-
-import org.apache.james.managesieve.api.SieveParser;
-import org.apache.james.managesieve.core.CoreProcessor;
-import org.apache.james.managesieve.mailet.transcode.MessageToCoreToMessage;
-import org.apache.james.managesieve.mailet.transcode.MessageToCoreToMessage.HelpProvider;
-import org.apache.james.managesieve.transcode.LineToCore;
-import org.apache.james.managesieve.transcode.LineToCoreToLine;
-import org.apache.james.managesieve.util.SettableSession;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.mailet.base.GenericMailet;
-
-/**
- * <code>ManageSieveMailet</code> interprets mail from a local sender as
- * commands to manage Sieve scripts stored on the mail server. The commands are
- * a subset of those defined by <a
- * href=http://tools.ietf.org/html/rfc5804#section
- * -2>http://tools.ietf.org/html/rfc5804#section-2 "MessageToCoreToMessage"</a>.
- * 
- * <p>
- * For each supported command and associated response, the format is the same as
- * defined by RFC 5804, with the exception that when Sieve scripts are involved
- * in the exchange they are attached to the mail with the MIME type of
- * 'application/sieve' rather than being embedded in the command.
- * 
- * <p>
- * The command is written in the subject header of a mail received by this
- * mailet. Responses from this mailet are sent to the sender as mail with the
- * message body containing the response.
- * 
- * <p>
- * The following commands are supported:
- * <ul>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.4>CAPABILITY</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.5>HAVESPACE</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.6>PUTSCRIPT</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.7>LISTSCRIPTS</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.8>SETACTIVE</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.9>GETSCRIPT</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.10>DELETESCRIPT</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.11>RENAMESCRIPT</a>
- * <li><a href=http://tools.ietf.org/html/rfc5804#section-2.12>CHECKSCRIPT</a>
- * </ul>
- * 
- * <h2>An Important Note About Security</h2>
- * <p>
- * The mail server on which this mailet is deployed MUST robustly authenticate
- * the sender, who MUST be local.
- * <p>
- * Sieve provides powerful email processing capabilities that if hijacked can
- * expose the mail of individuals and organisations to intruders.
- */
-public class ManageSieveMailet extends GenericMailet implements HelpProvider {
-
-    private class MailSession extends SettableSession {
-
-        public MailSession() {
-            super();
-        }
-
-        /**
-         * @param mail
-         *            the mail to set
-         */
-        public void setMail(Mail mail) {
-            setUser(getUser(mail.getSender()));
-            setAuthentication(null != mail.getAttribute(SMTP_AUTH_USER_ATTRIBUTE_NAME));
-        }
-
-        protected String getUser(MailAddress addr) {
-            return addr.getLocalPart() + '@' + (null == addr.getDomain() ? "localhost" : addr.getDomain());
-        }
-
-    }
-
-    public final static String SMTP_AUTH_USER_ATTRIBUTE_NAME = "org.apache.james.SMTPAuthUser";
-
-    private MailSession _session = null;
-
-    // Injected
-    private SieveRepository _sieveRepository = null;
-
-    // Injected
-    private SieveParser _sieveParser = null;
-
-    private MessageToCoreToMessage _transcoder = null;
-    
-    private URL _helpURL = null;
-    
-    private String _help = null;
-    
-    private boolean _cache = true;
-
-    /**
-     * Creates a new instance of ManageSieveMailet.
-     * 
-     */
-    public ManageSieveMailet() {
-        super();
-    }
-    
-    /**
-     * Creates a new instance of ManageSieveMailet.
-     *
-     * @param sieveRepository
-     * @param sieveParser
-     */
-    public ManageSieveMailet(SieveRepository sieveRepository, SieveParser sieveParser)
-    {
-        this();
-        setSieveRepository(sieveRepository);
-        setSieveParser(sieveParser);
-    }
-     
-    /**
-     * @see org.apache.mailet.base.GenericMailet#init()
-     */
-    @Override
-    public void init() throws MessagingException {
-        super.init();
-        // Validate resources
-        if (null == _sieveParser)
-        {
-            throw new MessagingException("Missing resource \"sieveparser\"");
-        }
-        if (null == _sieveRepository)
-        {
-            throw new MessagingException("Missing resource \"sieverepository\"");
-        }
-        
-        setHelpURL(getInitParameter("helpURL"));
-        _cache = getInitParameter("cache", true);
-        _session = new MailSession();
-        _transcoder = new MessageToCoreToMessage(new LineToCoreToLine(new LineToCore(new CoreProcessor(_session,
-                _sieveRepository, _sieveParser))), this);
-    }
-    
-    protected void setHelpURL(String helpURL) throws MessagingException
-    {
-        try
-        {
-            _helpURL = new URL(helpURL);
-        }
-        catch (MalformedURLException ex)
-        {
-            throw new MessagingException("Invalid helpURL", ex);
-        }
-    } 
-
-    /**
-     * @see org.apache.mailet.base.GenericMailet#service(org.apache.mailet.Mail)
-     */
-    @Override
-    public void service(Mail mail) throws MessagingException {
-
-        // Sanity checks
-        if (null == mail.getSender()) {
-            getMailetContext().log("ERROR: Sender is null");
-            return;
-        }
-
-        if (!getMailetContext().isLocalServer(mail.getSender().getDomain().toLowerCase())) {
-            getMailetContext().log("ERROR: Sender not local");
-            return;
-        }
-
-        // Update the Session for the current mail and execute
-        _session.setMail(mail);
-        getMailetContext().sendMail(_transcoder.execute(mail.getMessage()));
-        mail.setState(Mail.GHOST);
-        
-        // And tidy up
-        clearCaches();
-    }
-    
-    protected void clearCaches()
-    {
-        if (!_cache)
-        {
-            _help = null;
-        }
-    }
-
-    public String getHelp() throws MessagingException {
-        if (null == _help)
-        {
-            _help = computeHelp();
-        }
-        return _help;
-    }
-    
-    protected String computeHelp() throws MessagingException
-    {
-        InputStream stream = null;
-        String help = null;
-        try {
-            stream = _helpURL.openStream();
-            help = new Scanner(stream, "UTF-8").useDelimiter("\\A").next();
-        } catch (IOException ex) {
-            throw new MessagingException("Unable to access help URL: " + _helpURL.toExternalForm(), ex);
-        }
-        finally
-        {
-            if (null != stream)
-            {
-                try {
-                    stream.close();
-                } catch (IOException ex) {
-                    // no op
-                }
-            }
-        }
-        return help;
-    }
-
-    /**
-     */
-    @Inject
-    public void setSieveRepository(SieveRepository repository) {
-        _sieveRepository = repository;
-    }
-
-    /**
-     * @param sieveParser
-     *            the sieveParser to set
-     */
-    @Inject
-    public void setSieveParser(SieveParser sieveParser) {
-        _sieveParser = sieveParser;
-    }
-
-    /**
-     * @see org.apache.mailet.base.GenericMailet#getMailetInfo()
-     */
-    @Override
-    public String getMailetInfo() {
-        return getClass().getName();
-    }
-
-}
diff --git a/manager/mailet/src/main/java/org/apache/james/managesieve/mailet/transcode/MessageToCoreToMessage.java b/manager/mailet/src/main/java/org/apache/james/managesieve/mailet/transcode/MessageToCoreToMessage.java
deleted file mode 100644
index 376fd80..0000000
--- a/manager/mailet/src/main/java/org/apache/james/managesieve/mailet/transcode/MessageToCoreToMessage.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- *   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.managesieve.mailet.transcode;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Scanner;
-
-import javax.activation.DataHandler;
-import javax.mail.Address;
-import javax.mail.MessagingException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.util.ByteArrayDataSource;
-
-import org.apache.james.managesieve.transcode.LineToCoreToLine;
-import org.apache.james.managesieve.util.ParserUtils;
-import org.apache.mailet.base.RFC2822Headers;
-
-/**
- * <code>MessageToCoreToMessage</code>
- */
-public class MessageToCoreToMessage {
-    
-    public interface HelpProvider {
-        abstract public String getHelp() throws MessagingException;
-    }   
-    
-    protected static String getScript(MimeMessage message) throws IOException, MessagingException {
-        String result = null;
-        if (message.getContentType().startsWith("multipart/")) {
-            MimeMultipart parts = (MimeMultipart) message.getContent();
-            boolean found = false;
-            // Find the first part with any of:
-            // - an attachment type of "application/sieve"
-            // - a file suffix of ".siv"
-            // - a file suffix of ".sieve"
-            for (int i = 0; !found && i < parts.getCount(); i++) {
-                MimeBodyPart part = (MimeBodyPart) parts.getBodyPart(i);
-                found = part.isMimeType("application/sieve");
-                if (!found) {
-                    String fileName = null == part.getFileName() ? null : part.getFileName()
-                            .toLowerCase();
-                    found = null != fileName
-                            && (fileName.endsWith(".siv") || fileName.endsWith(".sieve"));
-                }
-                if (found) {
-                    Object content = part.getContent();
-                    if (content instanceof String) {
-                        return (String) part.getContent();
-                    }
-                    InputStream is = (InputStream) part.getContent();
-                    Scanner scanner = null;
-                    try {
-                        scanner = new Scanner(is, "UTF-8").useDelimiter("\\A");
-                        if (scanner.hasNext()) {
-                            result = scanner.next();
-                        }
-                    } finally {
-                        if (null != scanner) {
-                            scanner.close();
-                        }
-                    }
-                }
-            }
-        }
-        if (null == result)
-        {
-            throw new MessagingException("Script part not found in this message");
-        }
-        return result;
-    }
-
-    protected static MimeBodyPart toPart(String name, String content) throws MessagingException,
-            IOException {
-        MimeBodyPart scriptPart = new MimeBodyPart();
-        scriptPart.setDataHandler(
-                new DataHandler(
-                        new ByteArrayDataSource(
-                                content,
-                                "application/sieve; charset=UTF-8")
-                          ));
-        scriptPart.setDisposition(MimeBodyPart.ATTACHMENT);
-        scriptPart.setFileName(name);
-        return scriptPart;
-    }
-
-    protected static MimeBodyPart toPart(String message) throws MessagingException {
-        MimeBodyPart part = new MimeBodyPart();
-        part.setText(message);
-        part.setDisposition(MimeBodyPart.INLINE);
-        return part;
-    }
-    
-    private interface Executable {
-        public MimeMultipart execute(String operands, MimeMessage message)
-                throws MessagingException;
-    }
-
-    private Map<String, Executable> _commands = null;
-    
-    private LineToCoreToLine _adapter = null;
-    
-    private HelpProvider _helpProvider = null;
-    
-    private MessageToCoreToMessage()
-    {
-        super();
-        _commands = computeCommands();
-    }
-    
-    public MessageToCoreToMessage(LineToCoreToLine adapter, HelpProvider helpProvider)
-    {
-        this();
-        _adapter = adapter;
-        _helpProvider = helpProvider;
-    }
-    
-    public MimeMessage execute(MimeMessage message) throws MessagingException {
-        // Extract the command and operands from the subject
-        String subject = null == message.getSubject() ? "" : message.getSubject();
-        String[] args = subject.split(" ", 2);
-        // If there are no arguments, reply with help
-        String command = 0 == args.length ? "HELP" : args[0].toUpperCase();
-        Executable executable = null;
-        // If the command isn't supported, reply with help
-        if (null == (executable = _commands.get(command))) {
-            executable = _commands.get("HELP");
-        }
-        // Execute the resultant command...
-        MimeMultipart content = executable.execute(args.length > 1 ? args[1] : "", message);
-        // ...and wrap it in a MimeMessage
-        MimeMessage reply = (MimeMessage) message.reply(false);
-        reply.setContent(content);
-        if (null == message.getAllRecipients() || 0 >= message.getAllRecipients().length) {
-            throw new MessagingException("Message has no recipients");
-        } else {
-            Address from = message.getAllRecipients()[0];
-            reply.setFrom(from);
-        }
-        reply.saveChanges();
-        return reply;
-    }
-    
-    protected Map<String, Executable> computeCommands() {
-        Map<String, Executable> commands = new HashMap<String, Executable>();
-        commands.put("HELP", new Executable() {
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return help(operands, message);
-            }
-        });
-        commands.put("CAPABILITY", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return capability(operands, message);
-            }
-        });
-        commands.put("CHECKSCRIPT", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return checkScript(operands, message);
-            }
-        });
-        commands.put("DELETESCRIPT", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return deleteScript(operands, message);
-            }
-        });
-        commands.put("GETSCRIPT", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return getScript(operands, message);
-            }
-        });
-        commands.put("HAVESPACE", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return haveSpace(operands, message);
-            }
-        });
-        commands.put("LISTSCRIPTS", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return listScripts(operands, message);
-            }
-        });
-        commands.put("PUTSCRIPT", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return putScript(operands, message);
-            }
-        });
-        commands.put("RENAMESCRIPT", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return renameScript(operands, message);
-            }
-        });
-        commands.put("SETACTIVE", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return setActive(operands, message);
-            }
-        });
-        commands.put("GETACTIVE", new Executable() {
-
-            public MimeMultipart execute(String operands, MimeMessage message)
-                    throws MessagingException {
-                return getActive(operands, message);
-            }
-        });
-
-        return commands;
-    }
-
-    protected MimeMultipart help(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_helpProvider.getHelp()));
-        return multipart;
-    }
-
-    protected MimeMultipart capability(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_adapter.capability(operands)));
-        return multipart;
-    }
-
-    protected MimeMultipart checkScript(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        String result = null;
-        Scanner scanner = new Scanner(operands).useDelimiter("\\A");
-        if (scanner.hasNext()) {
-            result = "NO \"Too many arguments: " + scanner.next() + "\"";
-        } else {
-            try {
-                String content = getScript(message);
-                result = _adapter.checkScript(content);
-            } catch (MessagingException ex) {
-                result = "NO \"" + ex.getMessage() + "\"";
-            } catch (IOException ex) {
-                result = "NO \"Failed to read script part\"";
-            }
-        }
-        multipart.addBodyPart(toPart(result));
-        return multipart;
-    }
-
-    protected MimeMultipart deleteScript(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_adapter.deleteScript(operands)));
-        return multipart;
-    }
-
-    protected MimeMultipart getScript(String operands, MimeMessage message)
-                throws MessagingException {
-        String result = _adapter.getScript(operands);
-        // Everything but the last line is the script
-        // The last line is the response
-        String response = null;
-        String script = null;
-        int endOfScript = result.lastIndexOf("\r\n");
-        if (endOfScript > 0) {
-            script = result.substring(0, endOfScript);
-            response = result.substring(endOfScript + "\r\n".length());
-        } else {
-            response = result;
-        }
-
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(response));
-        if (null != script) {
-            try {
-                multipart.addBodyPart(toPart(ParserUtils.unquote(ParserUtils
-                            .getScriptName(operands)), script));
-            } catch (IOException ex) {
-                throw new MessagingException("Failed to add script part", ex);
-            }
-        }
-        return multipart;
-    }
-
-    protected MimeMultipart haveSpace(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_adapter.haveSpace(operands)));
-        return multipart;
-    }
-
-    protected MimeMultipart listScripts(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_adapter.listScripts(operands)));
-        return multipart;
-    }
-
-    protected MimeMultipart putScript(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        String result = null;
-        String scriptName = ParserUtils.getScriptName(operands);
-        if (null == scriptName || scriptName.isEmpty()) {
-            result = "NO \"Missing argument: script name\"";
-        } else {
-            Scanner scanner = new Scanner(operands.substring(scriptName.length()).trim())
-                    .useDelimiter("\\A");
-            if (scanner.hasNext()) {
-                result = "NO \"Too many arguments: " + scanner.next() + "\"";
-            } else {
-                StringBuilder builder = new StringBuilder(scriptName);
-                String content = null;
-                try {
-                    content = getScript(message);
-                } catch (MessagingException ex) {
-                    result = "NO \"" + ex.getMessage() + "\"";
-                } catch (IOException ex) {
-                    result = "NO \"Failed to read script part\"";
-                }
-                if (null != content) {
-                    builder
-                            .append(' ')
-                            .append(content);
-                }
-                result = _adapter.putScript(builder.toString().trim());
-            }
-        }
-        multipart.addBodyPart(toPart(result));
-        return multipart;
-    }
-
-    protected MimeMultipart renameScript(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_adapter.renameScript(operands)));
-        return multipart;
-    }
-
-    protected MimeMultipart setActive(String operands, MimeMessage message)
-                throws MessagingException {
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(_adapter.setActive(operands)));
-        return multipart;
-    }
-
-    protected MimeMultipart getActive(String operands, MimeMessage message)
-            throws MessagingException {
-        String result = _adapter.getActive(operands);
-        _adapter.getActive(operands);
-        // Everything but the last line is the script
-        // The last line is the response
-        String response = null;
-        String script = null;
-        int endOfScript = result.lastIndexOf("\r\n");
-        if (endOfScript > 0) {
-            script = result.substring(0, endOfScript);
-            response = result.substring(endOfScript + "\r\n".length());
-        } else {
-            response = result;
-        }
-
-        MimeMultipart multipart = new MimeMultipart();
-        multipart.addBodyPart(toPart(response));
-        if (null != script) {
-            try {
-                multipart.addBodyPart(toPart("active", script));
-            } catch (IOException ex) {
-                throw new MessagingException("Failed to add script part", ex);
-            }
-        }
-        return multipart;
-    }
-
-}
diff --git a/manager/mailet/src/main/resources/managesieve.help.txt b/manager/mailet/src/main/resources/managesieve.help.txt
deleted file mode 100644
index f45c78d..0000000
--- a/manager/mailet/src/main/resources/managesieve.help.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-managesieve implements the commands defined by RFC 5804 ((http://tools.ietf.org/html/rfc5804) to manage sieve scripts via mail messages. A mail is sent to the managesieve user with the command and parameters in the subject header. Sieve scripts are exchanged as mail attachments.
-
-Consult your mail administrator for the name of the managesieve user configured for your installation.
-
-Users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP commands (see note (1) below).
-
-Commands are executed and answered within the namespace of the sending user as denoted by the sender header of the mail. Thus, a command such as LISTSCRIPTS lists the scripts within namespace of the user identified by the sender header.
-
-The supported commands are summarised in "Command Summary" below. Generally the responses are self describing. For full details see RFC 5804 - Commands (http://tools.ietf.org/html/rfc5804#section-2).
-
-In these descriptions the following keywords apply:
-
-- sieve-name
-    The name of a sieve script enclosed in parentheses, eg: "my script". An empty name is not allowed.
-- active-sieve-name
-    As sieve-name, except an empty name, eg: "", is allowed.
-- old-sieve-name
-    As sieve-name
-- new-sieve-name
-    As sieve-name    
-- sieve-script
-    A mail attachment recognised as a sieve script. This is the first attachment in a mail satisfying any of these characteristics:
-        - A MIME type of "application/sieve"
-        - A filename with the suffix ".sieve"
-        - A filename with the suffix ".siv"
-    Returned sieve-scripts always have the MIME type of "application/sieve"
-
-Command Summary
----------------
-
-CAPABILITY
-    Subject:
-        CAPABILITY
-    Attachments: 
-        none
-Answers the capabilities of the underlying sieve inplementation.
-
-CHECKSCRIPT
-    Subject:
-        CHECKSCRIPT
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script without storing it on the server.
-
-DELETESCRIPT
-    Subject: 
-        DELETESCRIPT sieve-name
-    Attachments: 
-        none
-Deletes the named sieve script.
-
-GETACTIVE
-    Subject: 
-        GETACTIVE
-    Attachments: 
-        none
-Answers the active sieve script as an attachment.
-
-GETSCRIPT
-    Subject: 
-        GETSCRIPT sieve-name
-    Attachments: 
-        none
-Answers the named sieve script as an attachment.
-
-HAVESPACE
-    Subject: 
-        HAVESPACE sieve-name number
-    Attachments: 
-        none
-Answers OK if there is available space to store a script with the given name of the given size, else NO.
-
-HELP
-    Subject: 
-        HELP
-    Attachments: 
-        none
-Answers this text.
-
-LISTSCRIPTS
-    Subject: 
-        LISTSCRIPTS
-    Attachments: 
-        none
-Answers a list of the sieve scripts stored on the server, indicating which, if any, is the active script.
-
-PUTSCRIPT
-    Subject: 
-        PUTSCRIPT sieve-name
-    Attachments: 
-        sieve-script
-Verifies the attached sieve-script and if there are no errors stores it on the server using the given name.
-
-RENAMESCRIPT
-    Subject: 
-        RENAMESCRIPT old-sieve-name new-sieve-name
-    Attachments: 
-        none
-Renames the script stored on the server named old-sieve-name to new-sieve-name.
-
-SETACTIVE
-    Subject: 
-        SETACTIVE active-sieve-name
-    Attachments: 
-        none
-Sets the active script on the server to the given name. Use an empty string, "", to deactivate all scripts.
-
-Notes
------
-1) Some mail servers optionally allow configurations that enable local clients to post without SMTP authentication, such configurations will fail as managesieve requires SMTP authentication in all circumstances. To repeat, users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP commands.
-
-
diff --git a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/ManageSieveMailetTestCase.java b/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/ManageSieveMailetTestCase.java
deleted file mode 100644
index ca51738..0000000
--- a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/ManageSieveMailetTestCase.java
+++ /dev/null
@@ -1,1194 +0,0 @@
-/*
- *   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.managesieve.mailet;
-
-import org.apache.james.managesieve.mock.MockSieveParser;
-import org.apache.james.managesieve.mock.MockSieveRepository;
-import org.apache.james.sieverepository.api.exception.DuplicateUserException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.sieverepository.api.exception.StorageException;
-import org.apache.james.sieverepository.api.exception.UserNotFoundException;
-import org.apache.mailet.Mail;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import javax.activation.DataHandler;
-import javax.mail.Address;
-import javax.mail.BodyPart;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMessage.RecipientType;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.util.ByteArrayDataSource;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Scanner;
-
-public class ManageSieveMailetTestCase {
-
-    ManageSieveMailet _mailet = null;
-    SieveRepository _repository = null;
-    MockSieveParser _parser = null;
-
-    @Before
-    public void setUp() throws Exception {
-        _mailet = new ManageSieveMailet();
-        _repository = new MockSieveRepository();
-        _parser = new MockSieveParser();
-        _mailet.setSieveParser(_parser);
-        _mailet.setSieveRepository(_repository);
-        MockMailetConfig config = new MockMailetConfig(new MockMailetContext());
-        config.setInitParameter("helpURL", "file:./src/test/resources/help.txt");
-        _mailet.init(config);
-    }
-
-    @Test
-    public final void testCapability() throws MessagingException, IOException {
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("CAPABILITY");
-        message.setSender(new InternetAddress("test@localhost"));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        _parser.setExtensions(Arrays.asList("a", "b", "c"));
-
-        // Unauthorised
-        _mailet.service(mail);
-        MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-        assertNotNull(result);
-        // Check the subject header
-        assertEquals("Re: CAPABILITY", result.getSubject());
-        // Check the recipient
-        Address[] recipients = result.getRecipients(RecipientType.TO);
-        assertEquals(1, recipients.length);
-        assertEquals(message.getSender(), recipients[0]);
-        // Check the response
-        MimeMultipart multipart = (MimeMultipart) result.getContent();
-        assertEquals(1, multipart.getCount());
-        BodyPart part = multipart.getBodyPart(0);
-        String response = (String) part.getContent();
-        Scanner scanner = new Scanner(response);
-        Map<String, String> capabilities = new HashMap<String, String>();
-        while (scanner.hasNextLine()) {
-            String key = scanner.next();
-            String value = null;
-            if (scanner.hasNextLine()) {
-                value = scanner.nextLine().trim();
-            }
-            capabilities.put(key, value);
-        }
-        assertEquals("1.0", capabilities.get("VERSION"));
-        assertEquals("a b c", capabilities.get("SIEVE"));
-        assertEquals("Apache ManageSieve v1.0", capabilities.get("IMPLEMENTATION"));
-        assertEquals(null, capabilities.get("OK"));
-
-        // Authorised
-        mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, "test");
-        _mailet.service(mail);
-        // Check the response
-        result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-        multipart = (MimeMultipart) result.getContent();
-        assertEquals(1, multipart.getCount());
-        part = multipart.getBodyPart(0);
-        response = (String) part.getContent();
-        scanner = new Scanner(response);
-        capabilities = new HashMap<String, String>();
-        while (scanner.hasNextLine()) {
-            String key = scanner.next();
-            String value = null;
-            if (scanner.hasNextLine()) {
-                value = scanner.nextLine().trim();
-            }
-            capabilities.put(key, value);
-        }
-        assertEquals("1.0", capabilities.get("VERSION"));
-        assertEquals(message.getSender().toString(), capabilities.get("OWNER"));
-        assertEquals("a b c", capabilities.get("SIEVE"));
-        assertEquals("Apache ManageSieve v1.0", capabilities.get("IMPLEMENTATION"));
-        assertEquals(null, capabilities.get("OK"));
-
-        // Extra arguments should be rejected
-        message.setSubject("CAPABILITY extra");
-        message.saveChanges();
-        _mailet.service(mail);
-        result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-        multipart = (MimeMultipart) result.getContent();
-        assertEquals(1, multipart.getCount());
-        part = multipart.getBodyPart(0);
-        response = (String) part.getContent();
-        assertEquals("NO \"Too many arguments: extra\"", response);
-
-
-    }
-
-    @Test
-    public final void testPutScript() throws MessagingException, IOException, UserNotFoundException, ScriptNotFoundException, StorageException {
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        String scriptName = "scriptName";
-        String scriptContent = "scriptContent";
-        message.setSubject("PUTSCRIPT \"" + scriptName + "\"");
-        message.setSender(new InternetAddress("test@localhost"));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        MimeMultipart multipart = new MimeMultipart();
-        MimeBodyPart scriptPart = new MimeBodyPart();
-        scriptPart.setDataHandler(
-                new DataHandler(
-                        new ByteArrayDataSource(
-                                scriptContent,
-                                "application/sieve; charset=UTF-8")
-                ));
-        scriptPart.setDisposition(MimeBodyPart.ATTACHMENT);
-        // setting a DataHandler with no mailcap definition is not
-        // supported by the specs. Javamail activation still work,
-        // but Geronimo activation translate it to text/plain. 
-        // Let's manually force the header.
-        scriptPart.setHeader("Content-Type", "application/sieve; charset=UTF-8");
-        scriptPart.setFileName(scriptName);
-        multipart.addBodyPart(scriptPart);
-        message.setContent(multipart);
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: PUTSCRIPT \"" + scriptName + "\"", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals(response, "OK (WARNINGS) \"warning1\" \"warning2\"");
-            assertEquals(scriptContent, _repository.getScript(message.getSender().toString(), scriptName));
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("PUTSCRIPT \"" + scriptName + "\" extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // Syntax Error
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("PUTSCRIPT \"" + scriptName + "\"");
-            message.setSender(new InternetAddress("test@localhost"));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            multipart = new MimeMultipart();
-            scriptPart = new MimeBodyPart();
-            scriptPart.setDataHandler(
-                    new DataHandler(
-                            new ByteArrayDataSource(
-                                    "SyntaxException",
-                                    "application/sieve; charset=UTF-8")
-                    ));
-            scriptPart.setHeader("Content-Type", "application/sieve; charset=UTF-8");
-            scriptPart.setDisposition(MimeBodyPart.ATTACHMENT);
-            scriptPart.setFileName(scriptName);
-            multipart.addBodyPart(scriptPart);
-            message.setContent(multipart);
-            message.saveChanges();
-            mail.setMessage(message);
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertTrue(response.startsWith("NO \"Syntax Error: "));
-            assertEquals(scriptContent, _repository.getScript(message.getSender().toString(), scriptName));
-        }
-
-        // No script
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("PUTSCRIPT \"" + scriptName + "\"");
-            message.setSender(new InternetAddress("test@localhost"));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            message.saveChanges();
-            mail.setMessage(message);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script content\"", response);
-        }
-
-        // No script name
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("PUTSCRIPT");
-            message.setSender(new InternetAddress("test@localhost"));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            message.saveChanges();
-            mail.setMessage(message);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script name\"", response);
-        }
-    }
-
-    @Test
-    public final void testGetScript() throws MessagingException, IOException, UserNotFoundException, StorageException, QuotaExceededException, DuplicateUserException {
-        String scriptName = "scriptName";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, scriptName, scriptContent);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("GETSCRIPT \"" + scriptName + "\"");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: GETSCRIPT \"" + scriptName + "\"", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response);
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, user);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(2, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response);
-            BodyPart part2 = multipart.getBodyPart(1);
-            String script = null;
-            Scanner scanner = null;
-            try {
-                scanner = new Scanner((InputStream) part2.getContent(), "UTF-8").useDelimiter("\\A");
-                script = scanner.next();
-            } finally {
-                if (null != scanner) {
-                    scanner.close();
-                }
-            }
-            assertEquals(scriptContent, script);
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("GETSCRIPT \"" + scriptName + "\" extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // No such script
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("GETSCRIPT \"" + scriptName + "X\"");
-            message.setSender(new InternetAddress(user));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            message.saveChanges();
-            mail.setMessage(message);
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, user);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO (NONEXISTENT) \"There is no script by that name\"", response);
-        }
-
-        // No such user
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("GETSCRIPT \"" + scriptName + "\"");
-            message.setSender(new InternetAddress(user + "X"));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            message.saveChanges();
-            mail.setMessage(message);
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, user);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO (NONEXISTENT) \"There is no script by that name\"", response);
-        }
-
-        // No script name
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("GETSCRIPT");
-            message.setSender(new InternetAddress(user));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            message.saveChanges();
-            mail.setMessage(message);
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, user);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script name\"", response);
-        }
-
-    }
-
-
-    @Test
-    public final void testCheckScript() throws MessagingException, IOException, UserNotFoundException, ScriptNotFoundException {
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        String scriptName = "scriptName";
-        String scriptContent = "scriptContent";
-        message.setSubject("CHECKSCRIPT");
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.setSender(new InternetAddress("test@localhost"));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        MimeMultipart multipart = new MimeMultipart();
-        MimeBodyPart scriptPart = new MimeBodyPart();
-        scriptPart.setDataHandler(
-                new DataHandler(
-                        new ByteArrayDataSource(
-                                scriptContent,
-                                "application/sieve; charset=UTF-8")
-                ));
-        scriptPart.setHeader("Content-Type", "application/sieve; charset=UTF-8");
-        scriptPart.setDisposition(MimeBodyPart.ATTACHMENT);
-        scriptPart.setFileName(scriptName);
-        multipart.addBodyPart(scriptPart);
-        message.setContent(multipart);
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: CHECKSCRIPT", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK (WARNINGS) \"warning1\" \"warning2\"", response);
-        }
-
-        // Extra arguments should be rejected
-        {
-            message.setSubject("CHECKSCRIPT extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // Syntax Error
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("CHECKSCRIPT");
-            message.setSender(new InternetAddress("test@localhost"));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            multipart = new MimeMultipart();
-            scriptPart = new MimeBodyPart();
-            scriptPart.setDataHandler(
-                    new DataHandler(
-                            new ByteArrayDataSource(
-                                    "SyntaxException",
-                                    "application/sieve; charset=UTF-8")
-                    ));
-            scriptPart.setHeader("Content-Type", "application/sieve; charset=UTF-8");
-            scriptPart.setDisposition(MimeBodyPart.ATTACHMENT);
-            scriptPart.setFileName(scriptName);
-            multipart.addBodyPart(scriptPart);
-            message.setContent(multipart);
-            message.saveChanges();
-            mail.setMessage(message);
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertTrue(response.startsWith("NO \"Syntax Error: "));
-        }
-
-        // No script
-        {
-            message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-            message.setSubject("CHECKSCRIPT");
-            message.setSender(new InternetAddress("test@localhost"));
-            message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-            message.saveChanges();
-            mail.setMessage(message);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Script part not found in this message\"", response);
-        }
-
-    }
-
-    @Test
-    public final void testDeleteScript() throws DuplicateUserException, StorageException, UserNotFoundException, QuotaExceededException, MessagingException, IOException {
-        String scriptName = "scriptName";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, scriptName, scriptContent);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("DELETESCRIPT \"" + scriptName + "\"");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: DELETESCRIPT \"" + scriptName + "\"", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response.trim());
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("DELETESCRIPT \"" + scriptName + "\" extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // No script name
-        {
-            message.setSubject("DELETESCRIPT");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script name\"", response.trim());
-        }
-
-    }
-
-    @Test
-    public final void testHaveSpace() throws DuplicateUserException, StorageException, UserNotFoundException, QuotaExceededException, MessagingException, IOException {
-        String scriptName = "scriptName";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, scriptName, scriptContent);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("HAVESPACE \"" + scriptName + "\" 1");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: HAVESPACE \"" + scriptName + "\" 1", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response.trim());
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("HAVESPACE \"" + scriptName + "\" 1 extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // No script name
-        {
-            message.setSubject("HAVESPACE");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script name\"", response.trim());
-        }
-
-        // No script size
-        {
-            message.setSubject("HAVESPACE \"" + scriptName + "\"");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script size\"", response.trim());
-        }
-
-        // Invalid script size
-        {
-            message.setSubject("HAVESPACE \"" + scriptName + "\" X");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Invalid argument: script size\"", response.trim());
-        }
-
-    }
-
-    @Test
-    public final void testListScripts() throws MessagingException, DuplicateUserException, StorageException, UserNotFoundException, QuotaExceededException, ScriptNotFoundException, IOException {
-        String scriptName1 = "scriptName1";
-        String scriptName2 = "scriptName2";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, scriptName1, scriptContent);
-        _repository.putScript(user, scriptName2, scriptContent);
-        _repository.setActive(user, scriptName2);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("LISTSCRIPTS");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: LISTSCRIPTS", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("\"scriptName2\" ACTIVE\r\n\"scriptName1\"\r\nOK", response.trim());
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("LISTSCRIPTS extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-    }
-
-    @Test
-    public final void testRenameScripts() throws MessagingException, DuplicateUserException, StorageException, UserNotFoundException, QuotaExceededException, IOException {
-        String oldScriptName = "oldScriptName";
-        String newScriptName = "newScriptName";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, oldScriptName, scriptContent);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("RENAMESCRIPT \"" + oldScriptName + "\" \"" + newScriptName + "\"");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: RENAMESCRIPT \"" + oldScriptName + "\" \"" + newScriptName + "\"", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response.trim());
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("RENAMESCRIPT \"" + oldScriptName + "\" \"" + newScriptName + "\" extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // No script names
-        {
-            message.setSubject("RENAMESCRIPT");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: old script name\"", response.trim());
-        }
-
-        // No new script name
-        {
-            message.setSubject("RENAMESCRIPT \"" + oldScriptName + "\"");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: new script name\"", response.trim());
-        }
-
-    }
-
-    @Test
-    public final void testSetActive() throws DuplicateUserException, StorageException, UserNotFoundException, QuotaExceededException, MessagingException, IOException {
-        String scriptName = "scriptName";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, scriptName, scriptContent);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("SETACTIVE \"" + scriptName + "\"");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: SETACTIVE \"" + scriptName + "\"", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response.trim());
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, message.getSender().toString());
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response.trim());
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("SETACTIVE \"" + scriptName + "\" extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // No script name
-        {
-            message.setSubject("SETACTIVE");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Missing argument: script name\"", response.trim());
-        }
-
-        // Deactivated
-        {
-            message.setSubject("SETACTIVE \"\"");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response.trim());
-            boolean thrown = false;
-            try {
-                _repository.getActive(user);
-            } catch (ScriptNotFoundException ex) {
-                thrown = true;
-            }
-            assertTrue("Expected ScriptNotFoundException", thrown);
-        }
-
-    }
-
-    @Test
-    public final void testGetActive() throws MessagingException, UserNotFoundException, ScriptNotFoundException, StorageException, QuotaExceededException, DuplicateUserException, IOException {
-        String scriptName = "scriptName";
-        String scriptContent = "line1\r\nline2";
-        String user = "test@localhost";
-        _repository.addUser(user);
-        _repository.putScript(user, scriptName, scriptContent);
-        _repository.setActive(user, scriptName);
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("GETACTIVE");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Unauthorised
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: GETACTIVE", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO", response);
-        }
-
-        // Authorised
-        {
-            mail.setAttribute(ManageSieveMailet.SMTP_AUTH_USER_ATTRIBUTE_NAME, user);
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(2, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("OK", response);
-            BodyPart part2 = multipart.getBodyPart(1);
-            String script = null;
-            Scanner scanner = null;
-            try {
-                scanner = new Scanner((InputStream) part2.getContent(), "UTF-8").useDelimiter("\\A");
-                script = scanner.next();
-            } finally {
-                if (null != scanner) {
-                    scanner.close();
-                }
-            }
-            assertEquals(scriptContent, script);
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("GETACTIVE extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("NO \"Too many arguments: extra\"", response);
-        }
-
-        // Deactivated
-        {
-            _repository.setActive(user, "");
-            message.setSubject("GETACTIVE");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            // Check the response
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertTrue(response.trim().startsWith("NO (NONEXISTENT)"));
-        }
-
-    }
-
-    @Ignore("Ignore this test as it depends of your environment (file path changes with your position in the project)")
-    @Test
-    public final void testHelp() throws MessagingException, IOException {
-        String user = "test@localhost";
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("HELP");
-        message.setSender(new InternetAddress(user));
-        message.setRecipient(RecipientType.TO, new InternetAddress("sieve@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-
-        // Explicit invocation
-        {
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: HELP", result.getSubject());
-            // Check the recipient
-            Address[] recipients = result.getRecipients(RecipientType.TO);
-            assertEquals(1, recipients.length);
-            assertEquals(message.getSender(), recipients[0]);
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("Help text", response);
-        }
-
-        // Extra arguments
-        {
-            message.setSubject("HELP extra");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            MimeMultipart content = (MimeMultipart) result.getContent();
-            assertEquals(1, content.getCount());
-            BodyPart part = content.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("Help text", response);
-        }
-
-        // Implicit invocation - no subject header
-        {
-            message.removeHeader("subject");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals(null, result.getSubject());
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("Help text", response);
-        }
-
-        // Implicit invocation - empty subject
-        {
-            message.setSubject("");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            // Javamail returns "Re: " instead Geronimo returns "Re:" (no trailing space)
-            assertEquals("Re:", result.getSubject().trim());
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("Help text", response);
-        }
-
-        // Implicit invocation - invalid command
-        {
-            message.setSubject("INVALID");
-            message.saveChanges();
-            _mailet.service(mail);
-            MimeMessage result = ((MockMailetContext) _mailet.getMailetContext()).getMessage();
-            assertNotNull(result);
-            // Check the subject header
-            assertEquals("Re: INVALID", result.getSubject());
-            // Check the response
-            MimeMultipart multipart = (MimeMultipart) result.getContent();
-            assertEquals(1, multipart.getCount());
-            BodyPart part = multipart.getBodyPart(0);
-            String response = (String) part.getContent();
-            assertEquals("Help text", response);
-        }
-    }
-
-    /*
-    @Test
-    public final void testMessageWrap() throws MessagingException, IOException {
-        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
-        message.setSubject("CAPABILITY");
-        message.setSender(new InternetAddress("test@localhost"));
-        message.saveChanges();
-        Mail mail = new MockMail();
-        mail.setMessage(message);
-        
-        _parser.setExtensions(Arrays.asList(new String[]{"a","b","c"}));
-        
-        _mailet.service(mail);
-        MimeMessage result = ((MockMailetContext)_mailet.getMailetContext()).getMessage();
-        MimeMessageWrapper wrapped = new MimeMessageWrapper(result);
-    }
-    */
-}
diff --git a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMail.java b/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMail.java
deleted file mode 100644
index d0c9463..0000000
--- a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMail.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- *   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.managesieve.mailet;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-
-/**
- * <code>MockMail</code>
- */
-public class MockMail implements Mail {
-
-    private static final long serialVersionUID = 6535523029509031395L;
-    
-    MimeMessage _message = null;
-    Map<String, Serializable> _attributes = new HashMap<String, Serializable>();
-
-    /**
-     * @see org.apache.mailet.Mail#getAttribute(java.lang.String)
-     */
-    public Serializable getAttribute(String arg0) {
-        return _attributes.get(arg0);
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getAttributeNames()
-     */
-    @SuppressWarnings("unchecked")
-    public Iterator getAttributeNames() {
-        return _attributes.keySet().iterator();
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getErrorMessage()
-     */
-    public String getErrorMessage() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getLastUpdated()
-     */
-    public Date getLastUpdated() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getMessage()
-     */
-    public MimeMessage getMessage() throws MessagingException {
-        return _message;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getMessageSize()
-     */
-    public long getMessageSize() throws MessagingException {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getName()
-     */
-    public String getName() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getRecipients()
-     */
-    @SuppressWarnings("unchecked")
-    public Collection getRecipients() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getRemoteAddr()
-     */
-    public String getRemoteAddr() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getRemoteHost()
-     */
-    public String getRemoteHost() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getSender()
-     */
-    public MailAddress getSender() {
-        MailAddress addr = null;
-        try {
-            addr = new MailAddress((InternetAddress)_message.getSender());
-        } catch (AddressException ex) {
-        } catch (MessagingException ex) {
-        }
-        return addr;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#getState()
-     */
-    public String getState() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#hasAttributes()
-     */
-    public boolean hasAttributes() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#removeAllAttributes()
-     */
-    public void removeAllAttributes() {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#removeAttribute(java.lang.String)
-     */
-    public Serializable removeAttribute(String arg0) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setAttribute(java.lang.String, java.io.Serializable)
-     */
-    public Serializable setAttribute(String arg0, Serializable arg1) {
-        return _attributes.put(arg0, arg1);
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setErrorMessage(java.lang.String)
-     */
-    public void setErrorMessage(String arg0) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setLastUpdated(java.util.Date)
-     */
-    public void setLastUpdated(Date arg0) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setMessage(javax.mail.internet.MimeMessage)
-     */
-    public void setMessage(MimeMessage arg0) {
-        _message = arg0;
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setName(java.lang.String)
-     */
-    public void setName(String arg0) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setRecipients(java.util.Collection)
-     */
-    @SuppressWarnings("unchecked")
-    public void setRecipients(Collection arg0) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see org.apache.mailet.Mail#setState(java.lang.String)
-     */
-    public void setState(String arg0) {
-        // TODO Auto-generated method stub
-
-    }
-
-}
diff --git a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMailetConfig.java b/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMailetConfig.java
deleted file mode 100644
index e09a779..0000000
--- a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMailetConfig.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *   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.managesieve.mailet;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.mailet.MailetConfig;
-import org.apache.mailet.MailetContext;
-
-/**
- * <code>MockMailetConfig</code>
- */
-public class MockMailetConfig implements MailetConfig {
-    
-    private MailetContext _context = null;
-    
-    private Map<String, String> _parameters = null;
-
-    /**
-     * Creates a new instance of MockMailetConfig.
-     *
-     * @param context
-     */
-    public MockMailetConfig(MailetContext context) {
-        super();
-        _context = context;
-        _parameters = new HashMap<String, String>();
-    } 
-    
-    /**
-     * @see org.apache.mailet.MailetConfig#getInitParameter(java.lang.String)
-     */
-    public String getInitParameter(String s) {
-        return _parameters.get(s);
-    }
-    
-    public void setInitParameter(String k, String v) {
-        _parameters.put(k, v);
-    }
-
-    /**
-     * @see org.apache.mailet.MailetConfig#getInitParameterNames()
-     */
-    @SuppressWarnings("unchecked")
-    public Iterator getInitParameterNames() {
-        return _parameters.keySet().iterator();
-    }
-
-    /**
-     * @see org.apache.mailet.MailetConfig#getMailetContext()
-     */
-    public MailetContext getMailetContext() {
-        return _context;
-    }
-
-    /**
-     * @see org.apache.mailet.MailetConfig#getMailetName()
-     */
-    public String getMailetName() {
-        return "";
-    }
-
-}
diff --git a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMailetContext.java b/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMailetContext.java
deleted file mode 100644
index 29060b4..0000000
--- a/manager/mailet/src/test/java/org/apache/james/managesieve/mailet/MockMailetContext.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- *   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.managesieve.mailet;
-
-import org.apache.mailet.LookupException;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.mailet.MailetContext;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-public class MockMailetContext implements MailetContext {
-
-    private MimeMessage _message = null;
-
-    @Override
-    public void bounce(Mail mail, String s) throws MessagingException {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public void bounce(Mail mail, String s, MailAddress mailaddress) throws MessagingException {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public List<String> dnsLookup(String s, RecordType recordType) throws LookupException {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public Object getAttribute(String s) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Iterator getAttributeNames() {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Collection getMailServers(String s) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public int getMajorVersion() {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public int getMinorVersion() {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public MailAddress getPostmaster() {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public Iterator getSMTPHostAddresses(String s) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public String getServerInfo() {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public boolean isLocalEmail(MailAddress mailaddress) {
-        return false;
-    }
-
-    @Override
-    public boolean isLocalServer(String s) {
-        return s.equals("localhost");
-    }
-
-    @Override
-    public boolean isLocalUser(String s) {
-        return false;
-    }
-
-    @Override
-    public void log(String s) {
-        System.out.println(s);
-    }
-
-    @Override
-    public void log(String s, Throwable throwable) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public void log(LogLevel logLevel, String s) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public void log(LogLevel logLevel, String s, Throwable throwable) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public void removeAttribute(String s) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-
-    }
-
-    @Override
-    public void sendMail(MimeMessage mimemessage) throws MessagingException {
-        _message = mimemessage;
-    }
-
-    @Override
-    public void sendMail(Mail mail) throws MessagingException {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public void sendMail(MailAddress mailaddress, Collection collection, MimeMessage mimemessage)
-            throws MessagingException {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public void sendMail(MailAddress mailaddress, Collection collection, MimeMessage mimemessage,
-                         String s) throws MessagingException {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    @Override
-    public void setAttribute(String s, Object obj) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    public void storeMail(MailAddress mailaddress, MailAddress mailaddress1, MimeMessage mimemessage) {
-        throw new UnsupportedOperationException("Not yet implemented!");
-    }
-
-    public MimeMessage getMessage() {
-        return _message;
-    }
-
-}
diff --git a/manager/mailet/src/test/resources/help.txt b/manager/mailet/src/test/resources/help.txt
deleted file mode 100644
index 3873810..0000000
--- a/manager/mailet/src/test/resources/help.txt
+++ /dev/null
@@ -1 +0,0 @@
-Help text
\ No newline at end of file
diff --git a/manager/mock/pom.xml b/manager/mock/pom.xml
deleted file mode 100644
index fd6366f..0000000
--- a/manager/mock/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>apache-jsieve-manager</artifactId>
-        <version>0.6-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-    <artifactId>apache-jsieve-manager-mock</artifactId>
-    <packaging>bundle</packaging>
-    <name>Apache James :: jSieve :: Manager Mock</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>apache-jsieve-manager-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>james-server-data-api</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSession.java b/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSession.java
deleted file mode 100644
index 950ba70..0000000
--- a/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSession.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *   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.managesieve.mock;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.james.managesieve.api.Session;
-
-/**
- * <code>MockSession</code>
- */
-public class MockSession implements Session {
-
-    String _user = null;
-    boolean _isAuthenticated = false;
-    List<UserListener> _userListeners = new ArrayList<UserListener>();
-    List<AuthenticationListener> _authenticationListeners = new ArrayList<AuthenticationListener>(); 
-    
-    public MockSession()
-    {
-        super();
-    }
-
-    public void addAuthenticationListener(AuthenticationListener listener) {
-        _authenticationListeners.add(listener);
-    }
-
-    public void addUserListener(UserListener listener) {
-        _userListeners.add(listener);            
-    }
-
-    public String getUser() {
-        return _user;
-    }
-
-    public boolean isAuthenticated() {
-        return _isAuthenticated;
-    }
-
-    public void removeAuthenticationListener(AuthenticationListener listener) {
-        _authenticationListeners.remove(listener);
-    }
-
-    public void removeUserListener(UserListener listener) {
-        _userListeners.remove(listener);       
-    }
-
-    public void setAuthentication(boolean isAuthenticated) {
-        _isAuthenticated = isAuthenticated;
-        for(AuthenticationListener listener : _authenticationListeners)
-        {                  
-            listener.notifyChange(isAuthenticated);
-        }                
-    }
-
-    public void setUser(String user) {
-        _user = user;
-        for(UserListener listener : _userListeners)
-        {                  
-            listener.notifyChange(user);
-        }
-    }
-
-}
diff --git a/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSieveParser.java b/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSieveParser.java
deleted file mode 100644
index 696d668..0000000
--- a/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSieveParser.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.james.managesieve.mock;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.james.managesieve.api.SieveParser;
-import org.apache.james.managesieve.api.SyntaxException;
-
-/*
- *   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.
- *
- */
-
-/**
- * <code>MockSieveParser</code>
- */
-public class MockSieveParser implements SieveParser {
-    
-    private List<String> _extensions = null;
-
-    public MockSieveParser() {
-        super();
-    }
-
-    public List<String> getExtensions() {
-        return _extensions;
-    }
-    
-    public void setExtensions(List<String> extensions) {
-        _extensions = extensions;
-    }
-
-    public List<String> parse(String content) throws SyntaxException {
-        if (content.equals("SyntaxException"))
-        {
-            throw new SyntaxException("Ouch!");
-        }
-        return Arrays.asList("warning1", "warning2");
-    }
-
-}
diff --git a/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSieveRepository.java b/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSieveRepository.java
deleted file mode 100644
index b939473..0000000
--- a/manager/mock/src/main/java/org/apache/james/managesieve/mock/MockSieveRepository.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- *   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.managesieve.mock;
-
-import org.apache.james.sieverepository.api.exception.DuplicateException;
-import org.apache.james.sieverepository.api.exception.DuplicateUserException;
-import org.apache.james.sieverepository.api.exception.IsActiveException;
-import org.apache.james.sieverepository.api.exception.QuotaExceededException;
-import org.apache.james.sieverepository.api.exception.QuotaNotFoundException;
-import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.ScriptSummary;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.sieverepository.api.exception.StorageException;
-import org.apache.james.sieverepository.api.exception.UserNotFoundException;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-
-/**
- * <code>MockSieveRepository</code>
- */
-public class MockSieveRepository implements SieveRepository {
-    
-    public class SieveScript
-    {
-        private String _name = null;
-        private String _content = null;
-        private boolean _isActive = false;
-     
-        /**
-         * Creates a new instance of SieveScript.
-         *
-         */
-        private SieveScript() {
-            super();
-        }
-        
-        /**
-         * Creates a new instance of SieveScript.
-         *
-         */
-        public SieveScript(String content, boolean isActive) {
-            this();
-            setContent(content);
-            setActive(isActive);
-        }
-        
-        /**
-         * @return the name
-         */
-        public String getName() {
-            return _name;
-        }
-        
-        /**
-         * @param name the name to set
-         */
-        public void setName(String name) {
-            _name = name;
-        }
-        
-        /**
-         * @return the content
-         */
-        public String getContent() {
-            return _content;
-        }
-        
-        /**
-         * @param content the content to set
-         */
-        public void setContent(String content) {
-            _content = content;
-        }
-        
-        /**
-         * @return the isActive
-         */
-        public boolean isActive() {
-            return _isActive;
-        }
-        
-        /**
-         * @param isActive the isActive to set
-         */
-        public void setActive(boolean isActive) {
-            _isActive = isActive;
-        }
-    }
-    
-    Map<String,Map<String, SieveScript>> _repository = null;
-
-    /**
-     * Creates a new instance of MockSieveRepository.
-     *
-     */
-    public MockSieveRepository() {
-        _repository = new HashMap<String,Map<String, SieveScript>>();
-    }
-
-    /**
-     * @see SieveRepository#addUser(java.lang.String)
-     */
-    public void addUser(String user) throws DuplicateUserException, StorageException {
-        if (_repository.containsKey(user))
-        {
-            throw new DuplicateUserException(user);
-        }
-        _repository.put(user, new HashMap<String, SieveScript>());               
-    }
-
-    /**
-     * @see SieveRepository#deleteScript(java.lang.String, java.lang.String)
-     */
-    public void deleteScript(String user, String name) throws UserNotFoundException,
-            ScriptNotFoundException, IsActiveException, StorageException {
-        if (!_repository.containsKey(user))
-        {
-            throw new UserNotFoundException(user);
-        }
-        SieveScript script = _repository.get(user).get(name);
-        if (null == script)
-        {
-            throw new ScriptNotFoundException(name);
-        }
-        if (script.isActive())
-        {
-            throw new IsActiveException(name);
-        }
-        _repository.get(user).remove(name);
-    }
-
-    /**
-     * @see SieveRepository#getActive(java.lang.String)
-     */
-    public String getActive(String user) throws UserNotFoundException, ScriptNotFoundException {
-        if (!_repository.containsKey(user))
-        {
-            throw new UserNotFoundException(user);
-        }
-        Set<Entry<String, SieveScript>> scripts = _repository.get(user).entrySet();
-        String content = null;
-        for (final Entry<String, SieveScript> entry : scripts)
-        {
-            if (entry.getValue().isActive())
-            {
-                content = entry.getValue().getContent();
-                break;
-            }
-        }
-        if (null == content)
-        {
-            throw new ScriptNotFoundException();
-        }
-        return content;
-    }
-
-    /**
-     * @see SieveRepository#getQuota()
-     */
-    public long getQuota() throws QuotaNotFoundException {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    /**
-     * @see SieveRepository#getQuota(java.lang.String)
-     */
-    public long getQuota(String user) throws UserNotFoundException, QuotaNotFoundException {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    /**
-     * @see SieveRepository#getScript(java.lang.String, java.lang.String)
-     */
-    public String getScript(String user, String name) throws UserNotFoundException,
-            ScriptNotFoundException {
-        if (!_repository.containsKey(user))
-        {
-            throw new UserNotFoundException(user);
-        }
-        SieveScript script = _repository.get(user).get(name);
-        if (null == script)
-        {
-            throw new ScriptNotFoundException(name);
-        }
-        return script.getContent();
-    }
-
-    /**
-     * @see SieveRepository#hasQuota()
-     */
-    public boolean hasQuota() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /**
-     * @see SieveRepository#hasQuota(java.lang.String)
-     */
-    public boolean hasQuota(String user) throws UserNotFoundException {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /**
-     * @see SieveRepository#hasUser(java.lang.String)
-     */
-    public boolean hasUser(String user) {
-        return _repository.containsKey(user);
-    }
-
-    /**
-     * @see SieveRepository#haveSpace(java.lang.String, java.lang.String, long)
-     */
-    public void haveSpace(String user, String name, long size) throws UserNotFoundException,
-            QuotaExceededException {
-        if (!_repository.containsKey(user))
-        {
-            throw new UserNotFoundException(user);
-        }
-    }
-
-    /**
-     * @see SieveRepository#listScripts(java.lang.String)
-     */
-    public List<ScriptSummary> listScripts(String user) throws UserNotFoundException {
-        if (!_repository.containsKey(user))
-        {
-            throw new UserNotFoundException(user);
-        }
-        Set<Entry<String, SieveScript>> scripts = _repository.get(user).entrySet();
-        List<ScriptSummary> summaries = new ArrayList<ScriptSummary>(scripts.size());
-        for (final Entry<String, SieveScript> entry : scripts) {
-            summaries.add(new ScriptSummary(entry.getKey(), entry.getValue().isActive()));
-        }
-        return summaries;
-    }
-
-    /**
-     * @see SieveRepository#putScript(java.lang.String, java.lang.String, java.lang.String)
-     */
-    public void putScript(String user, String name, String content) throws UserNotFoundException,
-            StorageException, QuotaExceededException {
-        if (!_repository.containsKey(user))
-        {
-            throw new UserNotFoundException(user);
-        }
-        Map<String,SieveScript> scripts = _repository.get(user);
-        scripts.put(name, new SieveScript(content, false));
-    }
-
-    /**
-     * @see SieveRepository#removeQuota()
-     */
-    public void removeQuota() throws QuotaNotFoundException, StorageException {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see SieveRepository#removeQuota(java.lang.String)
-     */
-    public void removeQuota(String user) throws UserNotFoundException, QuotaNotFoundException,
-            StorageException {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see SieveRepository#removeUser(java.lang.String)
-     */
-    public void removeUser(String user) throws UserNotFoundException, StorageException {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see SieveRepository#renameScript(java.lang.String, java.lang.String, java.lang.String)
-     */
-    public void renameScript(String user, String oldName, String newName)
-            throws UserNotFoundException, ScriptNotFoundException,
-            DuplicateException, StorageException {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see SieveRepository#setActive(java.lang.String, java.lang.String)
-     */
-    public void setActive(String user, String name) throws UserNotFoundException,
-            ScriptNotFoundException, StorageException {
-
-        // Turn off currently active script, if any
-        Entry<String, SieveScript> oldActive = null;
-        oldActive = getActiveEntry(user);
-        if (null != oldActive) {
-            oldActive.getValue().setActive(false);
-        }
-
-        // Turn on the new active script if not an empty name
-        if ((null != name) && (!name.trim().isEmpty())) {
-            if (_repository.get(user).containsKey(name)) {
-                _repository.get(user).get(name).setActive(true);
-            } else {
-                if (null != oldActive) {
-                    oldActive.getValue().setActive(true);
-                }
-                throw new ScriptNotFoundException();
-            }
-        }
-    }
-    
-    protected Entry<String, SieveScript> getActiveEntry(String user)
-    {
-        Set<Entry<String, SieveScript>> scripts = _repository.get(user).entrySet();
-        Entry<String, SieveScript> activeEntry = null;
-        for (final Entry<String, SieveScript> entry : scripts)
-        {
-            if (entry.getValue().isActive())
-            {
-                activeEntry = entry;
-                break;
-            }
-        }
-        return activeEntry;
-    }
-
-    /**
-     * @see SieveRepository#setQuota(long)
-     */
-    public void setQuota(long quota) throws StorageException {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @see SieveRepository#setQuota(java.lang.String, long)
-     */
-    public void setQuota(String user, long quota) throws UserNotFoundException, StorageException {
-        // TODO Auto-generated method stub
-
-    }
-
-}
diff --git a/manager/pom.xml b/manager/pom.xml
deleted file mode 100644
index e0c8c8e..0000000
--- a/manager/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <parent>
-        <groupId>org.apache.james</groupId>
-        <artifactId>apache-jsieve</artifactId>
-        <version>0.6-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>apache-jsieve-manager</artifactId>
-    <packaging>pom</packaging>
-    <name>Apache James :: jSieve :: Manager</name>
-    <inceptionYear>2012</inceptionYear>
-
-    <modules>
-        <module>api</module>
-        <module>core</module>
-        <module>jsieve</module>
-        <module>mailet</module>
-        <module>mock</module>
-    </modules>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.apache.james</groupId>
-                <artifactId>james-server-data-api</artifactId>
-                <version>3.0.0-beta5-SNAPSHOT</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-</project>
diff --git a/pom.xml b/pom.xml
index fa2ebfc..5d36dae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,6 @@
         <module>all</module>
         <module>core</module>
         <module>mailet</module>
-        <module>manager</module>
         <module>util</module>
     </modules>