james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1720166 - in /james/project/trunk/server: data/data-api/src/main/resources/ mailet/mailets/ mailet/mailets/src/main/java/org/apache/james/transport/mailets/ mailet/mailets/src/test/java/org/apache/james/transport/mailets/ mailet/mailets/sr...
Date Tue, 15 Dec 2015 14:01:37 GMT
Author: btellier
Date: Tue Dec 15 14:01:37 2015
New Revision: 1720166

URL: http://svn.apache.org/viewvc?rev=1720166&view=rev
Log:
JAMES-1615 SieveMailet should use SieveRepository to retrieve user active Sieve script - contribued
by Erwan Guyomarc'h

Added:
    james/project/trunk/server/data/data-api/src/main/resources/sieverepository.xml
    james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ResourceLocatorImplTest.java
Modified:
    james/project/trunk/server/mailet/mailets/pom.xml
    james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java
    james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
    james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
    james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java
    james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java

Added: james/project/trunk/server/data/data-api/src/main/resources/sieverepository.xml
URL: http://svn.apache.org/viewvc/james/project/trunk/server/data/data-api/src/main/resources/sieverepository.xml?rev=1720166&view=auto
==============================================================================
--- james/project/trunk/server/data/data-api/src/main/resources/sieverepository.xml (added)
+++ james/project/trunk/server/data/data-api/src/main/resources/sieverepository.xml Tue Dec
15 14:01:37 2015
@@ -0,0 +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.                                           
+ -->
+
+<!-- See http://james.apache.org/server/3/config.html for usage -->
+<sieverepository class="org.apache.james.sieverepository.file">
+</sieverepository>

Modified: james/project/trunk/server/mailet/mailets/pom.xml
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/pom.xml?rev=1720166&r1=1720165&r2=1720166&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/pom.xml (original)
+++ james/project/trunk/server/mailet/mailets/pom.xml Tue Dec 15 14:01:37 2015
@@ -172,6 +172,10 @@
             <type>test-jar</type>
         </dependency>
         <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>

Modified: james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java?rev=1720166&r1=1720165&r2=1720166&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java
Tue Dec 15 14:01:37 2015
@@ -31,6 +31,7 @@ import org.apache.commons.collections.it
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.sieverepository.api.SieveRepository;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailetConfig;
@@ -51,7 +52,12 @@ public class LocalDelivery extends Gener
     private UsersRepository usersRepository;
     private MailboxManager mailboxManager;
     private DomainList domainList;
-    private FileSystem fileSystem;
+    private SieveRepository sieveRepository;
+
+    @Inject
+    public void setSieveRepository(SieveRepository sieveRepository) {
+        this.sieveRepository = sieveRepository;
+    }
 
     @Inject
     public void setRrt(org.apache.james.rrt.api.RecipientRewriteTable rrt) {
@@ -72,11 +78,6 @@ public class LocalDelivery extends Gener
     public void setDomainList(DomainList domainList) {
         this.domainList = domainList;
     }
-    
-    @Inject
-    public void setFileSystem(FileSystem fileSystem) {
-        this.fileSystem = fileSystem;
-    }
 
     private SieveMailet sieveMailet;  // Mailet that actually stores the message
     private RecipientRewriteTable recipientRewriteTable;  // Mailet that applies RecipientRewriteTable
@@ -116,14 +117,8 @@ public class LocalDelivery extends Gener
         recipientRewriteTable.setRecipientRewriteTable(rrt);
         recipientRewriteTable.init(getMailetConfig());
  
-        sieveMailet = new SieveMailet();
-        sieveMailet.setUsersRepository(usersRepository);
-        sieveMailet.setMailboxManager(mailboxManager);
-        sieveMailet.setFileSystem(fileSystem);
+        sieveMailet = new SieveMailet(usersRepository, mailboxManager, sieveRepository, "INBOX");
         sieveMailet.init(new MailetConfig() {
-            /*
-             * @see org.apache.mailet.MailetConfig#getInitParameter(java.lang.String)
-             */
             public String getInitParameter(String name) {
                 if ("addDeliveryHeader".equals(name)) {
                     return "Delivered-To";
@@ -133,9 +128,7 @@ public class LocalDelivery extends Gener
                     return getMailetConfig().getInitParameter(name);
                 }
             }
-            /*
-             * @see org.apache.mailet.MailetConfig#getInitParameterNames()
-             */
+
             public Iterator<String> getInitParameterNames() {
                 IteratorChain c = new IteratorChain();
                 Collection<String> h = new ArrayList<String>();
@@ -145,15 +138,11 @@ public class LocalDelivery extends Gener
                 c.addIterator(h.iterator());
                 return c;
             }
-            /*
-             * @see org.apache.mailet.MailetConfig#getMailetContext()
-             */
+
             public MailetContext getMailetContext() {
                 return getMailetConfig().getMailetContext();
             }
-            /*
-             * @see org.apache.mailet.MailetConfig#getMailetName()
-             */
+
             public String getMailetName() {
                 return getMailetConfig().getMailetName();
             }
@@ -161,8 +150,6 @@ public class LocalDelivery extends Gener
         });
         // Override the default value of "quiet"
         sieveMailet.setQuiet(getInitParameter("quiet", true));
-        sieveMailet.setFolder("INBOX");
-        
     }
 
 }

Modified: james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java?rev=1720166&r1=1720165&r2=1720166&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ResourceLocatorImpl.java
Tue Dec 15 14:01:37 2015
@@ -19,33 +19,31 @@
 
 package org.apache.james.transport.mailets;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
+import org.apache.james.sieverepository.api.exception.SieveRepositoryException;
+import org.apache.james.sieverepository.api.exception.StorageException;
+import org.apache.james.sieverepository.api.exception.UserNotFoundException;
+import org.apache.jsieve.mailet.ResourceLocator;
+
+import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.james.filesystem.api.FileSystem;
-import org.apache.jsieve.mailet.ResourceLocator;
-
-/**
- * To maintain backwards compatibility with existing installations, this uses
- * the old file based scheme.
- * <p> The scripts are stored in the <code>sieve</code> sub directory of
the application
- * installation directory.
- */
 public class ResourceLocatorImpl implements ResourceLocator {
 
     private final boolean virtualHosting;
-    
-    private FileSystem fileSystem = null;
+    private final SieveRepository sieveRepository;
 
-    public ResourceLocatorImpl(boolean virtualHosting, FileSystem fileSystem) {
+    public ResourceLocatorImpl(boolean virtualHosting, SieveRepository sieveRepository) {
         this.virtualHosting = virtualHosting;
-            this.fileSystem = fileSystem;
+        this.sieveRepository = sieveRepository;
     }
 
-    public InputStream get(String uri) throws IOException {
+    public InputStream get(String uri) throws SieveRepositoryException {
+        System.out.println(uri);
         // Use the complete email address for finding the sieve file
         uri = uri.substring(2);
 
@@ -56,15 +54,6 @@ public class ResourceLocatorImpl impleme
             username = uri.substring(0, uri.indexOf("@"));
         }
 
-        // RFC 5228 permits extensions: .siv .sieve
-        String sieveFilePrefix = FileSystem.FILE_PROTOCOL + "sieve/" + username + ".";
-        File sieveFile;
-        try {
-            sieveFile = fileSystem.getFile(sieveFilePrefix + "sieve");
-        } catch (FileNotFoundException ex) {
-            sieveFile = fileSystem.getFile(sieveFilePrefix + "siv");
-        }
-        return new FileInputStream(sieveFile);
+        return sieveRepository.getActive(username);
     }
-
 }

Modified: james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java?rev=1720166&r1=1720165&r2=1720166&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
Tue Dec 15 14:01:37 2015
@@ -18,14 +18,7 @@
  ****************************************************************/
 package org.apache.james.transport.mailets;
 
-import java.util.Date;
-
-import javax.inject.Inject;
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-
 import org.apache.james.core.MimeMessageInputStream;
-import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageManager;
@@ -33,6 +26,7 @@ import org.apache.james.mailbox.exceptio
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.sieverepository.api.SieveRepository;
 import org.apache.james.transport.util.MailetContextLog;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.james.user.api.UsersRepositoryException;
@@ -42,49 +36,31 @@ import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
 import org.apache.mailet.MailetConfig;
 
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+import java.util.Date;
+
 /**
  * Contains resource bindings.
  */
 public class SieveMailet extends SieveMailboxMailet implements Poster {
-    private UsersRepository usersRepos;
-    private MailboxManager mailboxManager;
-    private FileSystem fileSystem;
-    private String folder;
+    private final UsersRepository usersRepos;
+    private final MailboxManager mailboxManager;
+    private final SieveRepository sieveRepository;
+    private final String folder;
 
-    @Inject
-    public void setUsersRepository(UsersRepository usersRepos) {
+    public SieveMailet(UsersRepository usersRepos, MailboxManager mailboxManager, SieveRepository
sieveRepository, String folder) {
         this.usersRepos = usersRepos;
-    }
-
-    @Inject
-    public void setMailboxManager(MailboxManager mailboxManager) {
         this.mailboxManager = mailboxManager;
-    }
-
-    @Inject
-    public void setFileSystem(FileSystem fileSystem) {
-        this.fileSystem = fileSystem;
-    }
-
-    public void setFolder(String folder) {
+        this.sieveRepository = sieveRepository;
         this.folder = folder;
     }
 
-    public SieveMailet() {
-        super();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jsieve.mailet.SieveMailboxMailet#init(org.apache.mailet.
-     * MailetConfig)
-     */
     @Override
     public void init(MailetConfig config) throws MessagingException {
         // ATM Fixed implementation
         try {
-            setLocator(new ResourceLocatorImpl(usersRepos.supportVirtualHosting(), fileSystem));
+            setLocator(new ResourceLocatorImpl(usersRepos.supportVirtualHosting(), sieveRepository));
         } catch (UsersRepositoryException e) {
             throw new MessagingException("Unable to access UsersRepository", e);
         }

Modified: james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java?rev=1720166&r1=1720165&r2=1720166&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java
Tue Dec 15 14:01:37 2015
@@ -29,6 +29,7 @@ import javax.mail.MessagingException;
 import org.apache.commons.collections.iterators.IteratorChain;
 import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.sieverepository.api.SieveRepository;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailetConfig;
@@ -54,24 +55,22 @@ import org.apache.mailet.base.GenericMai
 public class ToRecipientFolder extends GenericMailet {
 
     private MailboxManager mailboxManager;
-
+    private SieveRepository sieveRepository;
     private UsersRepository usersRepository;
 
-    private FileSystem fileSystem;
-
     @Inject
     public void setMailboxManager(@Named("mailboxmanager")MailboxManager mailboxManager)
{
         this.mailboxManager = mailboxManager;
     }
 
     @Inject
-    public void setUsersRepository(UsersRepository usersRepository) {
-        this.usersRepository = usersRepository;
+    public void setSetUsersRepository(SieveRepository setUsersRepository) {
+        this.sieveRepository = setUsersRepository;
     }
 
     @Inject
-    public void setFileSystem(FileSystem fileSystem) {
-        this.fileSystem = fileSystem;
+    public void setUsersRepository(UsersRepository usersRepository) {
+        this.usersRepository = usersRepository;
     }
 
     private SieveMailet sieveMailet;  // Mailet that actually stores the message
@@ -94,10 +93,7 @@ public class ToRecipientFolder extends G
     @Override
     public void init() throws MessagingException {
         super.init();
-        sieveMailet = new SieveMailet();
-        sieveMailet.setUsersRepository(usersRepository);
-        sieveMailet.setMailboxManager(mailboxManager);
-        sieveMailet.setFileSystem(fileSystem);
+        sieveMailet = new SieveMailet(usersRepository, mailboxManager, sieveRepository, "INBOX");
         sieveMailet.init(new MailetConfig() {
             /*
              * @see org.apache.mailet.MailetConfig#getInitParameter(java.lang.String)
@@ -139,7 +135,6 @@ public class ToRecipientFolder extends G
         });
         // Override the default value of "quiet"
         sieveMailet.setQuiet(getInitParameter("quiet", true));
-        sieveMailet.setFolder(getInitParameter("folder", "INBOX"));
     }
 
     /* (non-Javadoc)

Added: james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ResourceLocatorImplTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ResourceLocatorImplTest.java?rev=1720166&view=auto
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ResourceLocatorImplTest.java
(added)
+++ james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ResourceLocatorImplTest.java
Tue Dec 15 14:01:37 2015
@@ -0,0 +1,57 @@
+/****************************************************************
+ * 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.transport.mailets;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+public class ResourceLocatorImplTest {
+
+    private SieveRepository sieveRepository;
+    private ResourceLocatorImpl resourceLocator;
+
+    @Before
+    public void setUp() {
+        sieveRepository = mock(SieveRepository.class);
+        resourceLocator = new ResourceLocatorImpl(true, sieveRepository);
+    }
+
+    @Test(expected = ScriptNotFoundException.class)
+    public void resourceLocatorImplShouldPropagateScriptNotFound() throws Exception {
+        when(sieveRepository.getActive("receiver@localhost")).thenThrow(new ScriptNotFoundException());
+        resourceLocator.get("//receiver@localhost/sieve");
+    }
+
+    @Test
+    public void resourceLocatorImplShouldWork() throws Exception {
+        InputStream inputStream = new ByteArrayInputStream(new byte[0]);
+        when(sieveRepository.getActive("receiver@localhost")).thenReturn(inputStream);
+        assertThat(resourceLocator.get("//receiver@localhost/sieve")).isEqualTo(inputStream);
+    }
+}

Modified: james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java?rev=1720166&r1=1720165&r2=1720166&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
Tue Dec 15 14:01:37 2015
@@ -27,12 +27,13 @@ import static org.mockito.Mockito.when;
 
 import com.google.common.collect.Lists;
 import org.apache.james.domainlist.api.DomainList;
-import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageManager;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.rrt.api.RecipientRewriteTable;
+import org.apache.james.sieverepository.api.SieveRepository;
+import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
 import org.apache.james.transport.mailets.LocalDelivery;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.mailet.Mail;
@@ -54,7 +55,6 @@ import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
 import javax.mail.util.ByteArrayDataSource;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Date;
@@ -63,26 +63,26 @@ import java.util.Properties;
 public class LocalDeliveryTest {
 
     private UsersRepository usersRepository;
-    private FileSystem fileSystem;
     private RecipientRewriteTable recipientRewriteTable;
     private MailboxManager mailboxManager;
     private DomainList domainList;
+    private SieveRepository sieveRepository;
     private LocalDelivery localDelivery;
 
     @Before
     public void setUp() throws Exception {
+        sieveRepository = mock(SieveRepository.class);
         usersRepository = mock(UsersRepository.class);
-        fileSystem = mock(FileSystem.class);
         recipientRewriteTable = mock(RecipientRewriteTable.class);
         mailboxManager = mock(MailboxManager.class);
         domainList = mock(DomainList.class);
 
         localDelivery = new LocalDelivery();
         localDelivery.setDomainList(domainList);
-        localDelivery.setFileSystem(fileSystem);
         localDelivery.setMailboxManager(mailboxManager);
         localDelivery.setRrt(recipientRewriteTable);
         localDelivery.setUsersRepository(usersRepository);
+        localDelivery.setSieveRepository(sieveRepository);
     }
 
     @Test
@@ -92,7 +92,7 @@ public class LocalDeliveryTest {
                 return true;
             }
         });
-        when(fileSystem.getFile(any(String.class))).thenThrow(FileNotFoundException.class);
+        when(sieveRepository.getActive("receiver@domain.com")).thenThrow(new ScriptNotFoundException());
         MailboxPath inbox = new MailboxPath("#private", "receiver@domain.com", "INBOX");
         final MessageManager messageManager = mock(MessageManager.class);
         when(mailboxManager.getMailbox(eq(inbox), any(MailboxSession.class))).thenAnswer(new
Answer<MessageManager>() {
@@ -129,7 +129,7 @@ public class LocalDeliveryTest {
                 return false;
             }
         });
-        when(fileSystem.getFile(any(String.class))).thenThrow(FileNotFoundException.class);
+        when(sieveRepository.getActive("receiver")).thenThrow(new ScriptNotFoundException());
         MailboxPath inbox = new MailboxPath("#private", "receiver", "INBOX");
         final MessageManager messageManager = mock(MessageManager.class);
         when(mailboxManager.getMailbox(eq(inbox), any(MailboxSession.class))).thenAnswer(new
Answer<MessageManager>() {



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


Mime
View raw message