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

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

Author: rdonkin
Date: Fri Dec 26 03:31:10 2008
New Revision: 729482

URL: http://svn.apache.org/viewvc?rev=729482&view=rev
Log:
Sieve mailet fixes plus smoke tests

Added:
    james/server/trunk/build-tools/imap-post-john-sieve.mpt   (contents, props changed)
      - copied, changed from r728077, james/server/trunk/build-tools/imap.mpt
    james/server/trunk/build-tools/imap-prep-john-sieve.mpt   (contents, props changed)
      - copied, changed from r728077, james/server/trunk/build-tools/imap.mpt
    james/server/trunk/build-tools/john.smith.sieve   (with props)
    james/server/trunk/build-tools/sieve-smtp.mpt   (with props)
Modified:
    james/server/trunk/build-tools/imap-sieve.mpt
    james/server/trunk/build-tools/sieve.xsl
    james/server/trunk/build-tools/smoke.xml
    james/server/trunk/build-tools/smoke.xsl
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
    james/server/trunk/stage/org.apache.james/jars/apache-jsieve-0.3-SNAPSHOT.jar
    james/server/trunk/stage/org.apache.james/jars/apache-jsieve-mailet-0.3-SNAPSHOT.jar
    james/server/trunk/stage/org.apache.james/jars/apache-mailet-base-1.0-SNAPSHOT.jar

Copied: james/server/trunk/build-tools/imap-post-john-sieve.mpt (from r728077, james/server/trunk/build-tools/imap.mpt)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/imap-post-john-sieve.mpt?p2=james/server/trunk/build-tools/imap-post-john-sieve.mpt&p1=james/server/trunk/build-tools/imap.mpt&r1=728077&r2=729482&rev=729482&view=diff
==============================================================================
--- james/server/trunk/build-tools/imap.mpt (original)
+++ james/server/trunk/build-tools/imap-post-john-sieve.mpt Fri Dec 26 03:31:10 2008
@@ -20,10 +20,27 @@
 C: abcd CAPABILITY
 S: \* CAPABILITY IMAP4rev1 LITERAL\+
 S: abcd OK CAPABILITY completed.
-C: 1 LOGIN user passwd 
+C: 1 LOGIN john.smith passwd
 S: 1 OK LOGIN completed.
-C: 2 CREATE sub
-S: 2 OK CREATE completed.
-C: 3 CREATE sub/way
-S: 3 OK CREATE completed.
+C: 2 SELECT INBOX
+S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)\]
+S: 2 OK \[READ-WRITE\] SELECT completed.
+C: 3 SELECT sub
+S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
+S: \* 1 EXISTS
+S: \* 0 RECENT
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[UNSEEN 1\]
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)\]
+S: 3 OK \[READ-WRITE\] SELECT completed.
+C: 4 FETCH 1 FULL
+S: \* 1 FETCH \(FLAGS \(\) INTERNALDATE \".*\" RFC822.SIZE .* ENVELOPE \(\"12 Dec 2008 GMT\" \"Hello\" \(\(NIL NIL "joe" "example.org"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"john.smith\" \"localhost\"\)\) NIL NIL NIL \".*\"\) BODY \(\"TEXT\" \"PLAIN\" \(\"charset\" \"us-ascii\"\) NIL NIL \"7BIT\" 16 2\)\)
+S: 4 OK FETCH completed.
+C: END LOGOUT
+S: \* BYE IMAP4rev1 Server logging out
+
 

Propchange: james/server/trunk/build-tools/imap-post-john-sieve.mpt
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: james/server/trunk/build-tools/imap-prep-john-sieve.mpt (from r728077, james/server/trunk/build-tools/imap.mpt)
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/imap-prep-john-sieve.mpt?p2=james/server/trunk/build-tools/imap-prep-john-sieve.mpt&p1=james/server/trunk/build-tools/imap.mpt&r1=728077&r2=729482&rev=729482&view=diff
==============================================================================
--- james/server/trunk/build-tools/imap.mpt (original)
+++ james/server/trunk/build-tools/imap-prep-john-sieve.mpt Fri Dec 26 03:31:10 2008
@@ -20,10 +20,10 @@
 C: abcd CAPABILITY
 S: \* CAPABILITY IMAP4rev1 LITERAL\+
 S: abcd OK CAPABILITY completed.
-C: 1 LOGIN user passwd 
+C: 1 LOGIN john.smith passwd
 S: 1 OK LOGIN completed.
 C: 2 CREATE sub
 S: 2 OK CREATE completed.
-C: 3 CREATE sub/way
-S: 3 OK CREATE completed.
+C: END LOGOUT
+S: \* BYE IMAP4rev1 Server logging out
 

Propchange: james/server/trunk/build-tools/imap-prep-john-sieve.mpt
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: james/server/trunk/build-tools/imap-sieve.mpt
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/imap-sieve.mpt?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
--- james/server/trunk/build-tools/imap-sieve.mpt (original)
+++ james/server/trunk/build-tools/imap-sieve.mpt Fri Dec 26 03:31:10 2008
@@ -31,7 +31,7 @@
 S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)\]
 S: 2 OK \[READ-WRITE\] SELECT completed.
 C: 3 FETCH 1 FULL
-S: \* 1 FETCH \(FLAGS \(\) INTERNALDATE \".*\" RFC822.SIZE .* ENVELOPE \(\"12 Dec 2008 GMT\" \"A Test Message\" \(\(NIL NIL "joe" "example.org"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"user\" \"localhost\"\)\) NIL NIL NIL NIL\) BODY \(\"TEXT\" \"PLAIN\" \(\"charset\" \"us-ascii\"\) NIL NIL \"7BIT\" 29 2\)\)
+S: \* 1 FETCH \(FLAGS \(\) INTERNALDATE \".*\" RFC822.SIZE .* ENVELOPE \(\"12 Dec 2008 GMT\" \"A Test Message\" \(\(NIL NIL "joe" "example.org"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"joe\" \"example.org\"\)\) \(\(NIL NIL \"user\" \"localhost\"\)\) NIL NIL NIL \".*\"\) BODY \(\"TEXT\" \"PLAIN\" \(\"charset\" \"us-ascii\"\) NIL NIL \"7BIT\" 29 2\)\)
 S: 3 OK FETCH completed.
 C: END LOGOUT
 S: \* BYE IMAP4rev1 Server logging out

Added: james/server/trunk/build-tools/john.smith.sieve
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/john.smith.sieve?rev=729482&view=auto
==============================================================================
--- james/server/trunk/build-tools/john.smith.sieve (added)
+++ james/server/trunk/build-tools/john.smith.sieve Fri Dec 26 03:31:10 2008
@@ -0,0 +1,6 @@
+require ["fileinto"];
+
+if header :is "Subject" "Hello"
+{
+   fileinto "sub";
+}
\ No newline at end of file

Propchange: james/server/trunk/build-tools/john.smith.sieve
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: james/server/trunk/build-tools/sieve-smtp.mpt
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/sieve-smtp.mpt?rev=729482&view=auto
==============================================================================
--- james/server/trunk/build-tools/sieve-smtp.mpt (added)
+++ james/server/trunk/build-tools/sieve-smtp.mpt Fri Dec 26 03:31:10 2008
@@ -0,0 +1,38 @@
+################################################################
+# 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.                                           #
+################################################################
+S: 220 .* SMTP Server \(JAMES SMTP Server .*
+C: HELO example.org
+S: 250 .* Hello example.org .*
+C: MAIL FROM:<jo...@example.org>
+S: 250 2.1.0 Sender <jo...@example.org> OK
+C: RCPT TO:<jo...@localhost>
+S: 250 2.1.5 Recipient <jo...@localhost> OK
+C: DATA
+S: 354 Ok Send data ending with <CRLF>.<CRLF>
+C: Date: 12 Dec 2008 GMT
+C: From: <jo...@example.org>
+C: To: <jo...@localhost>
+C: Subject: Hello
+C:
+C: Hello, John!
+C:
+C: .
+S: 250 2.6.0 Message received
+C: QUIT
+S: 221 2.0.0 .* Service closing transmission channel

Propchange: james/server/trunk/build-tools/sieve-smtp.mpt
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: james/server/trunk/build-tools/sieve.xsl
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/sieve.xsl?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
--- james/server/trunk/build-tools/sieve.xsl (original)
+++ james/server/trunk/build-tools/sieve.xsl Fri Dec 26 03:31:10 2008
@@ -1,4 +1,22 @@
 <?xml version ='1.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.
+-->
 <xsl:stylesheet version="1.1"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:strip-space elements = "*" />
@@ -29,6 +47,7 @@
 			<xsl:element name='mailet'>
 				<xsl:attribute name='match'>All</xsl:attribute>
 				<xsl:attribute name='class'>SieveMailet</xsl:attribute>
+				<xsl:element name='verbose'><xsl:text>true</xsl:text></xsl:element>
 			</xsl:element>
 		</xsl:element>
 	</xsl:template>		

Modified: james/server/trunk/build-tools/smoke.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/smoke.xml?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
--- james/server/trunk/build-tools/smoke.xml (original)
+++ james/server/trunk/build-tools/smoke.xml Fri Dec 26 03:31:10 2008
@@ -36,6 +36,13 @@
         </sequential>   
     </macrodef>   
     
+    <macrodef name='Smtp'>
+        <attribute name='script' default='smtp'/>
+        <sequential>
+            <mpt:mpt port='${org.apache.james.smoke.port.SMTP}' script='../build-tools/@{script}.mpt'/>   
+        </sequential>   
+    </macrodef>
+    
     <macrodef name='TestDelivery'>   
         <attribute name='smtp' default='delivery-smtp'/>
         <attribute name='pop3' default='pop3-after-smtp'/>   
@@ -188,12 +195,19 @@
                 app-path='@{app-path}' 
                 conf-path='@{conf-path}'
                 conf-file-name='@{conf-file-name}'
-                style='sieve'/>   
-
+                style='sieve'/>  
+               
             <BootJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}' log='@{log}'/>  
+            
+            <mkdir dir="${smoke.sieve.james.dir}/apps/james/var/sieve/"/>
+            <copy todir="${smoke.sieve.james.dir}/apps/james/var/sieve/" file="../build-tools/john.smith.sieve"/>
+               
             <InitMPT/>   
             <TestDelivery pop3="pop3" smtp="smtp"/>
-            <Imap script='imap-sieve'/>   
+            <Imap script='imap-sieve'/> 
+            <Imap script='imap-prep-john-sieve'/> 
+            <Smtp script='sieve-smtp'/>    
+            <Imap script='imap-post-john-sieve'/>    
             <StopJames dir='${smoke.sieve.james.dir}' cmd='@{cmd}'/>       
         </sequential>   
     </macrodef>    

Modified: james/server/trunk/build-tools/smoke.xsl
URL: http://svn.apache.org/viewvc/james/server/trunk/build-tools/smoke.xsl?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
--- james/server/trunk/build-tools/smoke.xsl (original)
+++ james/server/trunk/build-tools/smoke.xsl Fri Dec 26 03:31:10 2008
@@ -1,4 +1,23 @@
 <?xml version ='1.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.
+-->
+
 <xsl:stylesheet version="1.1"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:strip-space elements = "*" />

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java (original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/ResourceLocatorImpl.java Fri Dec 26 03:31:10 2008
@@ -34,7 +34,7 @@
 
     public InputStream get(String uri) throws IOException {
         // This is a toy implementation
-        String username = uri.substring(3, uri.indexOf('@'));
+        String username = uri.substring(2, uri.indexOf('@'));
         String sieveFileName = "../apps/james/var/sieve/"+username+".sieve";
         return new FileInputStream(sieveFileName);
     }

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java (original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/sieve/SieveMailet.java Fri Dec 26 03:31:10 2008
@@ -29,9 +29,16 @@
  */
 public class SieveMailet extends SieveMailboxMailet {
 
+    public SieveMailet() {
+        super();
+        // ATM Fixed implementation
+        setLocator(new ResourceLocatorImpl());
+    }
+
     @Resource(name="imapserver")
     @Override
     public void setPoster(Poster poster) {
         super.setPoster(poster);
     }
+    
 }

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

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

Modified: james/server/trunk/stage/org.apache.james/jars/apache-mailet-base-1.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/james/server/trunk/stage/org.apache.james/jars/apache-mailet-base-1.0-SNAPSHOT.jar?rev=729482&r1=729481&r2=729482&view=diff
==============================================================================
Binary files - no diff available.



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