JSIEVE-106 jsieve/mailet should be located in server/mailet/.../jsieve
diff --git a/all/pom.xml b/all/pom.xml
index c53e671..aaf13dc 100644
--- a/all/pom.xml
+++ b/all/pom.xml
@@ -47,10 +47,6 @@
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
- <artifactId>apache-jsieve-mailet</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.james</groupId>
<artifactId>apache-jsieve-util</artifactId>
</dependency>
</dependencies>
diff --git a/mailet/pom.xml b/mailet/pom.xml
deleted file mode 100644
index a26032a..0000000
--- a/mailet/pom.xml
+++ /dev/null
@@ -1,159 +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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>apache-jsieve</artifactId>
- <groupId>org.apache.james</groupId>
- <version>0.6-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <artifactId>apache-jsieve-mailet</artifactId>
- <packaging>bundle</packaging>
-
- <name>Apache James :: jSieve :: Mailet</name>
- <description>
- Apache jSieve is a server side mail filtering system
- implementing RFC3028. Apache jSieve is developed by the
- James project.
- </description>
- <inceptionYear>2004</inceptionYear>
-
- <distributionManagement>
- <site>
- <id>${james.www.id}</id>
- <url>${james.jsieve.www}/mailet</url>
- </site>
- </distributionManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.james</groupId>
- <artifactId>apache-jsieve-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>org.apache.james</groupId>
- <artifactId>apache-mime4j-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.james</groupId>
- <artifactId>apache-mime4j-dom</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.james</groupId>
- <artifactId>apache-mime4j-james-utils</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>2.9.2</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>test</scope>
- </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>jmock</groupId>
- <artifactId>jmock</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <!--
- Switches between generating the documentation site (without using this profile) and
- generating the technical reports site (using this profile)
- -->
- <profile>
- <id>site-reports</id>
- <build>
- <plugins>
- <!-- Site generation -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-descriptor</id>
- <goals>
- <goal>attach-descriptor</goal>
- </goals>
- <configuration>
- <siteDirectory>${basedir}/src/site</siteDirectory>
- <generateReports>false</generateReports>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <reportPlugins combine.children="append">
- <plugin>
- <groupId>org.apache.james</groupId>
- <artifactId>maven-mailetdocs-plugin</artifactId>
- </plugin>
- </reportPlugins>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/ActionContext.java b/mailet/src/main/java/org/apache/jsieve/mailet/ActionContext.java
deleted file mode 100644
index c719009..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/ActionContext.java
+++ /dev/null
@@ -1,82 +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.jsieve.mailet;
-
-import java.util.Collection;
-import java.util.Date;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-
-import org.apache.commons.logging.Log;
-import org.apache.mailet.MailAddress;
-import org.joda.time.DateTime;
-
-/**
- * Provides context for action execution.
- */
-public interface ActionContext {
-
- /**
- * @return Date the script was activated
- */
- DateTime getScriptActivationDate();
-
- /**
- * @return Date the script is currently interpreted
- */
- DateTime getScriptInterpretationDate();
-
- /**
- * @return Recipient receiving the given eMail
- */
- MailAddress getRecipient();
-
- /**
- * Gets the log.
- * @return not null
- */
- public Log getLog();
-
- /**
- * Experimental mail delivery.
- * POST verb indicate that mail should be attached to the collection
- * indicated by the given URI.
- *
- * @param uri indicates the destination to which the mail to added. ATM
- * the value should be mailbox://<user>@localhost/<mailbox-path>
- * @param mail not null
- */
- public void post(String uri, MimeMessage mail) throws MessagingException;
-
- /**
- * Posts the given mail.
- * @param sender possibly null
- * @param recipients not null
- * @param mail not null
- * @throws MessagingException when mail cannot be posted
- */
- public void post(MailAddress sender, Collection<MailAddress> recipients, MimeMessage mail) throws MessagingException;
-
- /**
- * Gets name (including version) of this server.
- * @return not nul
- */
- public String getServerInfo();
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/ActionDispatcher.java b/mailet/src/main/java/org/apache/jsieve/mailet/ActionDispatcher.java
deleted file mode 100644
index fed4bb4..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/ActionDispatcher.java
+++ /dev/null
@@ -1,99 +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.jsieve.mailet;
-
-import org.apache.jsieve.mail.*;
-import org.apache.jsieve.mail.optional.ActionVacation;
-import org.apache.mailet.Mail;
-
-import javax.mail.MessagingException;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * Dynamically dispatches an Action depending on the type of Action received at runtime.
- * <h4>Thread Safety</h4>
- * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
- */
-public class ActionDispatcher {
- /**
- * A Map keyed by the type of Action. The values are the methods to invoke to
- * handle the Action.
- * <Action, MailAction>
- */
- private ConcurrentMap<Class, MailAction> fieldMailActionMap;
-
- /**
- * Constructor for ActionDispatcher.
- *
- * @throws NoSuchMethodException
- */
- public ActionDispatcher() {
- super();
- setMethodMap(defaultMethodMap());
- }
-
- /**
- * Method execute executes the passed Action by invoking the method mapped by the
- * receiver with a parameter of the EXACT type of Action.
- *
- * @param anAction not null
- * @param aMail not null
- * @param context not null
- * @throws MessagingException
- */
- public void execute(final Action anAction, final Mail aMail, final ActionContext context) throws MessagingException {
- final MailAction mailAction = getMethodMap().get(anAction.getClass());
- mailAction.execute(anAction, aMail, context);
- }
-
- /**
- * Returns the methodMap.
- *
- * @return Map
- */
- public ConcurrentMap<Class, MailAction> getMethodMap() {
- return fieldMailActionMap;
- }
-
- /**
- * Returns a new methodMap.
- *
- * @return Map
- */
- private ConcurrentMap<Class, MailAction> defaultMethodMap() {
- final ConcurrentMap<Class, MailAction> actionMap = new ConcurrentHashMap<Class, MailAction>(4);
- actionMap.put(ActionFileInto.class, new FileIntoAction());
- actionMap.put(ActionKeep.class, new KeepAction());
- actionMap.put(ActionRedirect.class, new RedirectAction());
- actionMap.put(ActionReject.class, new RejectAction());
- actionMap.put(ActionVacation.class, new VacationAction());
- return actionMap;
- }
-
- /**
- * Sets the mail action mail.
- *
- * @param mailActionMap <Action, MailAction> not null
- */
- protected void setMethodMap(ConcurrentMap<Class, MailAction> mailActionMap) {
- fieldMailActionMap = mailActionMap;
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/ActionUtils.java b/mailet/src/main/java/org/apache/jsieve/mailet/ActionUtils.java
deleted file mode 100644
index 4e1d29e..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/ActionUtils.java
+++ /dev/null
@@ -1,80 +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.jsieve.mailet;
-
-import javax.mail.MessagingException;
-
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-
-/**
- * Utility methods helpful for actions.
- */
-public class ActionUtils
-{
-
- private final static String ATTRIBUTE_PREFIX = ActionUtils.class.getPackage().getName() + ".";
-
- /**
- * Answers the sole intended recipient for aMail.
- *
- * @param aMail
- * @return String
- * @throws MessagingException
- */
- public static MailAddress getSoleRecipient(Mail aMail) throws MessagingException
- {
- if (aMail.getRecipients() == null) {
- throw new MessagingException("Invalid number of recipients - 0"
- + ". Exactly 1 recipient is expected.");
- } else if (1 != aMail.getRecipients().size())
- throw new MessagingException("Invalid number of recipients - "
- + Integer.toString(aMail.getRecipients().size())
- + ". Exactly 1 recipient is expected.");
- return aMail.getRecipients().iterator().next();
- }
-
- /**
- * Detect and handle locally looping mail. External loop detection is left
- * to the MTA.
- *
- * @param aMail
- * @param context not null
- * @param anAttributeSuffix
- * @throws MessagingException
- */
- public static void detectAndHandleLocalLooping(Mail aMail, ActionContext context, String anAttributeSuffix)
- throws MessagingException
- {
- MailAddress thisRecipient = getSoleRecipient(aMail);
- MailAddress lastRecipient = (MailAddress) aMail
- .getAttribute(ATTRIBUTE_PREFIX + anAttributeSuffix);
- if (null != lastRecipient && lastRecipient.equals(thisRecipient))
- {
- MessagingException ex = new MessagingException(
- "This message is looping! Message ID: "
- + aMail.getMessage().getMessageID());
- context.getLog().warn(ex.getMessage(), ex);
- throw ex;
- }
- aMail.setAttribute(ATTRIBUTE_PREFIX + anAttributeSuffix,
- thisRecipient);
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/CommonsLoggingAdapter.java b/mailet/src/main/java/org/apache/jsieve/mailet/CommonsLoggingAdapter.java
deleted file mode 100644
index 809a0d5..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/CommonsLoggingAdapter.java
+++ /dev/null
@@ -1,142 +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.jsieve.mailet;
-
-import org.apache.commons.logging.Log;
-import org.apache.mailet.base.GenericMailet;
-
-/**
- * Adapts commons logging to mailet logging.
- */
-class CommonsLoggingAdapter implements Log {
-
- public static final int TRACE = 6;
- public static final int DEBUG = 5;
- public static final int INFO = 4;
- public static final int WARN = 3;
- public static final int ERROR = 2;
- public static final int FATAL = 1;
-
- private final GenericMailet mailet;
- private final int level;
-
- public CommonsLoggingAdapter(final GenericMailet mailet, final int level) {
- super();
- this.mailet = mailet;
- this.level = level;
- }
-
- public void debug(Object message) {
- if (isDebugEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString());
- }
- }
-
- public void debug(Object message, Throwable t) {
- if (isDebugEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString(), t);
- }
- }
-
- public void error(Object message) {
- if (isErrorEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString());
- }
- }
-
- public void error(Object message, Throwable t) {
- if (isErrorEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString(), t);
- }
- }
-
- public void fatal(Object message) {
- if (isFatalEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString());
- }
- }
-
- public void fatal(Object message, Throwable t) {
- if (isFatalEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString(), t);
- }
- }
-
- public void info(Object message) {
- if (isInfoEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString());
- }
- }
-
- public void info(Object message, Throwable t) {
- if (isInfoEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString(), t);
- }
- }
-
- public boolean isDebugEnabled() {
- return level <= DEBUG;
- }
-
- public boolean isErrorEnabled() {
- return level <= ERROR;
- }
-
- public boolean isFatalEnabled() {
- return level <= FATAL;
- }
-
- public boolean isInfoEnabled() {
- return level <= INFO;
- }
-
- public boolean isTraceEnabled() {
- return level <= TRACE;
- }
-
- public boolean isWarnEnabled() {
- return level <= WARN;
- }
-
- public void trace(Object message) {
- if (isTraceEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString());
- }
- }
-
- public void trace(Object message, Throwable t) {
- if (isTraceEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString(), t);
- }
- }
-
- public void warn(Object message) {
- if (isWarnEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString());
- }
- }
-
- public void warn(Object message, Throwable t) {
- if (isWarnEnabled()) {
- mailet.log(message == null ? "NULL" : message.toString(), t);
- }
- }
-
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/FileIntoAction.java b/mailet/src/main/java/org/apache/jsieve/mailet/FileIntoAction.java
deleted file mode 100644
index 45c4598..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/FileIntoAction.java
+++ /dev/null
@@ -1,142 +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.jsieve.mailet;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-
-import org.apache.commons.logging.Log;
-import org.apache.jsieve.mail.Action;
-import org.apache.jsieve.mail.ActionFileInto;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-
-/**
- * Performs the filing of a mail into a specified destination.
- * <h4>Thread Safety</h4>
- * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
- */
-public class FileIntoAction implements MailAction {
-
- private static final char HIERARCHY_DELIMITER = '.';
-
- public void execute(Action action, Mail mail, ActionContext context) throws MessagingException {
- if (action instanceof ActionFileInto) {
- final ActionFileInto fileIntoAction = (ActionFileInto) action;
- execute(fileIntoAction, mail, context);
- }
- }
-
- /**
- * <p>
- * Executes the passed ActionFileInto.
- * </p>
- *
- * <p>
- * This implementation accepts any destination with the root of <code>INBOX</code>.
- * </p>
- *
- * <p>
- * As the current POP3 server does not support sub-folders, the mail is
- * stored in the INBOX for the recipient of the mail and the full intended
- * destination added as a prefix to the message's subject.
- * </p>
- *
- * <p>
- * When IMAP support is added to James, it will be possible to support
- * sub-folders of <code>INBOX</code> fully.
- * </p>
- *
- * @param anAction
- * @param aMail
- * @param context not null
- * @throws MessagingException
- */
- @SuppressWarnings("deprecation")
- public void execute(ActionFileInto anAction, Mail aMail, final ActionContext context) throws MessagingException
- {
- String destinationMailbox = anAction.getDestination();
- MailAddress recipient;
- boolean delivered = false;
- try
- {
- recipient = ActionUtils.getSoleRecipient(aMail);
- MimeMessage localMessage = createMimeMessage(aMail, recipient);
-
- if (!(destinationMailbox.length() > 0
- && destinationMailbox.charAt(0) == HIERARCHY_DELIMITER)) {
- destinationMailbox = HIERARCHY_DELIMITER + destinationMailbox;
- }
-
- final String mailbox = destinationMailbox.replace(HIERARCHY_DELIMITER, '/');
- final String host;
- if (mailbox.charAt(0) == '/') {
- host = "@localhost";
- } else {
- host = "@localhost/";
- }
- final String url = "mailbox://" + recipient.getUser() + host + mailbox;
- //TODO: copying this message so many times seems a waste
- context.post(url, localMessage);
- delivered = true;
- }
- catch (MessagingException ex)
- {
- final Log log = context.getLog();
- if (log.isDebugEnabled()) {
- log.debug("Error while storing mail into. "+destinationMailbox, ex);
- }
- throw ex;
- }
- finally
- {
- // Ensure the mail is always ghosted
- aMail.setState(Mail.GHOST);
- }
- if (delivered)
- {
- final Log log = context.getLog();
- if (log.isDebugEnabled()) {
- log.debug("Filed Message ID: "
- + aMail.getMessage().getMessageID()
- + " into destination: \""
- + destinationMailbox + "\"");
- }
- }
- }
-
- private static MimeMessage createMimeMessage(Mail aMail, MailAddress recipient) throws MessagingException {
- // Adapted from LocalDelivery Mailet
- // Add qmail's de facto standard Delivered-To header
- MimeMessage localMessage = new MimeMessage(aMail.getMessage())
- {
- protected void updateHeaders() throws MessagingException
- {
- if (getMessageID() == null)
- super.updateHeaders();
- else
- modified = false;
- }
- };
- localMessage.addHeader("Delivered-To", recipient.toString());
-
- localMessage.saveChanges();
- return localMessage;
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/KeepAction.java b/mailet/src/main/java/org/apache/jsieve/mailet/KeepAction.java
deleted file mode 100644
index bad42b9..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/KeepAction.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.jsieve.mailet;
-
-import javax.mail.MessagingException;
-
-import org.apache.jsieve.mail.Action;
-import org.apache.jsieve.mail.ActionFileInto;
-import org.apache.jsieve.mail.ActionKeep;
-import org.apache.mailet.Mail;
-
-/**
- * Performs the filing of a mail into the inbox.
- * <h4>Thread Safety</h4>
- * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
- */
-public class KeepAction extends FileIntoAction implements MailAction {
-
- private static final String INBOX = "INBOX";
-
- public void execute(Action action, Mail mail, ActionContext context)
- throws MessagingException {
- if (action instanceof ActionKeep) {
- final ActionKeep actionKeep = (ActionKeep) action;
- execute(actionKeep, mail, context);
- }
- }
-
- /**
- * <p>
- * Executes the passed ActionKeep.
- * </p>
- *
- * <p>
- * In this implementation, "keep" is equivalent to "fileinto" with a
- * destination of "INBOX".
- * </p>
- *
- * @param anAction not null
- * @param aMail not null
- * @param context not null
- * @throws MessagingException
- */
- public void execute(ActionKeep anAction, Mail aMail, ActionContext context) throws MessagingException
- {
- final ActionFileInto action = new ActionFileInto(INBOX);
- execute(action, aMail, context);
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/MailAction.java b/mailet/src/main/java/org/apache/jsieve/mailet/MailAction.java
deleted file mode 100644
index 1255dc5..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/MailAction.java
+++ /dev/null
@@ -1,40 +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.jsieve.mailet;
-
-import javax.mail.MessagingException;
-
-import org.apache.jsieve.mail.Action;
-import org.apache.mailet.Mail;
-
-/**
- * Executes a Sieve action.
- * Implementations may be accessed concurrently by multiple threads.
- */
-public interface MailAction {
-
- /**
- * Executes the given action.
- * @param action not null
- * @param mail not null
- * @param context not null
- * @throws MessagingException when action cannot be executed
- */
- public void execute(final Action action, final Mail mail, final ActionContext context) throws MessagingException;
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/Poster.java b/mailet/src/main/java/org/apache/jsieve/mailet/Poster.java
deleted file mode 100644
index 079cf02..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/Poster.java
+++ /dev/null
@@ -1,40 +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.jsieve.mailet;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-
-/**
- * Experimental interface.
- */
-public interface Poster {
-
- /**
- * Experimental mail delivery.
- * POST verb indicate that mail should be attached to the collection
- * indicated by the given URI.
- *
- * @param uri indicates the destination to which the mail to added. ATM
- * the value should be mailbox://<user>@localhost/<mailbox-path>
- * @param mail not null
- */
- public void post(String uri, MimeMessage mail) throws MessagingException;
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/RedirectAction.java b/mailet/src/main/java/org/apache/jsieve/mailet/RedirectAction.java
deleted file mode 100644
index b68ed83..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/RedirectAction.java
+++ /dev/null
@@ -1,72 +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.jsieve.mailet;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.InternetAddress;
-
-import org.apache.commons.logging.Log;
-import org.apache.jsieve.mail.Action;
-import org.apache.jsieve.mail.ActionRedirect;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-
-/**
- * Performs the redirection of a mail.
- * <h4>Thread Safety</h4>
- * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
- */
-public class RedirectAction implements MailAction {
-
- public void execute(Action action, Mail mail, ActionContext context)
- throws MessagingException {
- if (action instanceof ActionRedirect) {
- final ActionRedirect actionRedirect = (ActionRedirect) action;
- execute(actionRedirect, mail, context);
- }
-
- }
-
- /**
- * Method execute executes the passed ActionRedirect.
- *
- * @param anAction not nul
- * @param aMail not null
- * @param context not null
- * @throws MessagingException
- */
- public void execute(ActionRedirect anAction, Mail aMail, ActionContext context) throws MessagingException
- {
- ActionUtils.detectAndHandleLocalLooping(aMail, context, "redirect");
- Collection<MailAddress> recipients = new ArrayList<MailAddress>(1);
- recipients.add(new MailAddress(new InternetAddress(anAction.getAddress())));
- MailAddress sender = aMail.getSender();
- context.post(sender, recipients, aMail.getMessage());
- aMail.setState(Mail.GHOST);
- Log log = context.getLog();
- if (log.isDebugEnabled()) {
- log.debug("Redirected Message ID: "
- + aMail.getMessage().getMessageID() + " to \""
- + anAction.getAddress() + "\"");
- }
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/RejectAction.java b/mailet/src/main/java/org/apache/jsieve/mailet/RejectAction.java
deleted file mode 100644
index 185e35d..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/RejectAction.java
+++ /dev/null
@@ -1,144 +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.jsieve.mailet;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.mail.Address;
-import javax.mail.MessagingException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-import org.apache.jsieve.mail.Action;
-import org.apache.jsieve.mail.ActionReject;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.jsieve.mailet.mdn.ActionModeAutomatic;
-import org.apache.jsieve.mailet.mdn.Disposition;
-import org.apache.jsieve.mailet.mdn.DispositionModifier;
-import org.apache.jsieve.mailet.mdn.MDNFactory;
-import org.apache.jsieve.mailet.mdn.ModifierError;
-import org.apache.jsieve.mailet.mdn.SendingModeAutomatic;
-import org.apache.jsieve.mailet.mdn.TypeDeleted;
-
-/**
- * Performs the rejection of a mail, with a reply to the sender.
- * <h4>Thread Safety</h4>
- * <p>An instance maybe safe accessed concurrently by multiple threads.</p>
- */
-public class RejectAction implements MailAction {
-
- public void execute(Action action, Mail mail, ActionContext context)
- throws MessagingException {
- if (action instanceof ActionReject) {
- final ActionReject actionReject = (ActionReject) action;
- execute(actionReject, mail, context);
- }
-
- }
-
- /**
- * <p>
- * Method execute executes the passed ActionReject. It sends an RFC 2098
- * compliant reject MDN back to the sender.
- * </p>
- * <p>
- * NOTE: The Mimecontent type should be 'report', but as we do not yet have
- * a DataHandler for this yet, its currently 'text'!
- *
- * @param anAction not null
- * @param aMail not null
- * @param context not null
- * @throws MessagingException
- */
- public void execute(ActionReject anAction, Mail aMail, ActionContext context) throws MessagingException
- {
- ActionUtils.detectAndHandleLocalLooping(aMail, context, "reject");
-
- // Create the MDN part
- StringBuilder humanText = new StringBuilder(128);
- humanText.append("This message was refused by the recipient's mail filtering program.");
- humanText.append("\r\n");
- humanText.append("The reason given was:");
- humanText.append("\r\n");
- humanText.append("\r\n");
- humanText.append(anAction.getMessage());
-
- String reporting_UA_name = null;
- try
- {
- reporting_UA_name = InetAddress.getLocalHost()
- .getCanonicalHostName();
- }
- catch (UnknownHostException ex)
- {
- reporting_UA_name = "localhost";
- }
-
- String reporting_UA_product = context.getServerInfo();
-
- String[] originalRecipients = aMail.getMessage().getHeader(
- "Original-Recipient");
- String original_recipient = null;
- if (null != originalRecipients && originalRecipients.length > 0)
- {
- original_recipient = originalRecipients[0];
- }
-
- MailAddress soleRecipient = ActionUtils.getSoleRecipient(aMail);
- String final_recipient = soleRecipient.toString();
-
- String original_message_id = aMail.getMessage().getMessageID();
-
- DispositionModifier modifiers[] = {new ModifierError()};
- Disposition disposition = new Disposition(new ActionModeAutomatic(),
- new SendingModeAutomatic(), new TypeDeleted(), modifiers);
-
- MimeMultipart multiPart = MDNFactory.create(humanText.toString(),
- reporting_UA_name, reporting_UA_product, original_recipient,
- final_recipient, original_message_id, disposition);
-
- // Send the message
- MimeMessage reply = (MimeMessage) aMail.getMessage().reply(false);
- reply.setFrom(soleRecipient.toInternetAddress());
- reply.setContent(multiPart);
- reply.saveChanges();
- Address[] recipientAddresses = reply.getAllRecipients();
- if (null != recipientAddresses)
- {
- Collection<MailAddress> recipients = new ArrayList<MailAddress>(recipientAddresses.length);
- for (Address recipientAddress : recipientAddresses) {
- recipients.add(new MailAddress(
- (InternetAddress) recipientAddress));
- }
- context.post(null, recipients, reply);
- }
- else
- {
- context.getLog().info("Unable to send reject MDN. Could not determine the recipient.");
- }
- // Ghost the original mail
- aMail.setState(Mail.GHOST);
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/ResourceLocator.java b/mailet/src/main/java/org/apache/jsieve/mailet/ResourceLocator.java
deleted file mode 100644
index 64ee54d..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/ResourceLocator.java
+++ /dev/null
@@ -1,92 +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.jsieve.mailet;
-
-import org.joda.time.DateTime;
-
-import java.io.InputStream;
-
-/**
- * <p>Experimental API locates resources.
- * Used to load Sieve scripts. The base for relative URLs
- * should be taken to be the root of the James configuration.
- * </p><p>
- * Required schemas:
- * </p>
- * <ul>
- * <li><strong>User sieve scripts</strong> - the relative URL scheme
- * <code>//<em>user</em>@<em>host</em>/<em>sieve</em> will be used to
- * obtain the script
- * </ul>
- * <p>
- * The advantage of using <code>URI</code>s
- * and verbs (for example <code>GET</code>, <code>POST</code>)
- * are their uniformity. The same API can be used to interface radically
- * different resource types and protocols. This allows concise, minimal,
- * powerful APIs to be created. Their simplicity is easy to preserved
- * across versions.
- * </p><p>
- * The disadvantage is that this free decouple means that there is
- * no gaurantee that the implementations decoupled by this interface
- * actually support the same scheme. Issues will be caught only
- * at deployment and not at compile time.
- * This places a larger burden on the deployer.
- * </p><p>
- * Either an understanding or a consistent URL mapping scheme may be
- * required. For example, <code>//john.smith@localhost/sieve</code>
- * may need to be resolved to <code>../apps/james/var/sieve/john.smith@localhost.sieve</code>
- * when using the file system to store scripts. Note that names <strong>MUST</strong>
- * be normalised before resolving on a file system.
- * </p>
- */
-public interface ResourceLocator {
-
- class UserSieveInformation {
- private DateTime scriptActivationDate;
- private DateTime scriptInterpretationDate;
- private InputStream scriptContent;
-
- public UserSieveInformation(DateTime scriptActivationDate, DateTime scriptInterpretationDate, InputStream scriptContent) {
- this.scriptActivationDate = scriptActivationDate;
- this.scriptInterpretationDate = scriptInterpretationDate;
- this.scriptContent = scriptContent;
- }
-
- public DateTime getScriptActivationDate() {
- return scriptActivationDate;
- }
-
- public DateTime getScriptInterpretationDate() {
- return scriptInterpretationDate;
- }
-
- public InputStream getScriptContent() {
- return scriptContent;
- }
- }
-
- /**
- * GET verb locates and loads a resource.
- * @param uri identifies the Sieve script
- * @return not null
- * @throws Exception when the resource cannot be located
- */
- UserSieveInformation get(String uri) throws Exception;
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/SieveMailAdapter.java b/mailet/src/main/java/org/apache/jsieve/mailet/SieveMailAdapter.java
deleted file mode 100644
index 93389f1..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/SieveMailAdapter.java
+++ /dev/null
@@ -1,504 +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.jsieve.mailet;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.james.mime4j.dom.address.AddressList;
-import org.apache.james.mime4j.dom.address.Mailbox;
-import org.apache.james.mime4j.dom.address.MailboxList;
-import org.apache.james.mime4j.dom.field.ParseException;
-import org.apache.james.mime4j.field.address.DefaultAddressParser;
-import org.apache.james.mime4j.utils.search.MessageMatcher;
-import org.apache.jsieve.SieveContext;
-import org.apache.jsieve.exception.InternetAddressException;
-import org.apache.jsieve.exception.SieveException;
-import org.apache.jsieve.mail.Action;
-import org.apache.jsieve.mail.AddressImpl;
-import org.apache.jsieve.mail.MailAdapter;
-import org.apache.jsieve.mail.MailUtils;
-import org.apache.jsieve.mail.SieveMailException;
-import org.apache.jsieve.mail.optional.EnvelopeAccessors;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.mailet.MailetContext;
-import org.joda.time.DateTime;
-
-import javax.mail.Header;
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-/**
- * <p>
- * Class <code>SieveMailAdapter</code> implements a <code>MailAdapter</code>
- * for use in a Mailet environment.
- * </p>
- */
-public class SieveMailAdapter implements MailAdapter, EnvelopeAccessors, ActionContext
-{
- private static final Log LOG = LogFactory.getLog(SieveMailAdapter.class);
-
- private Log log = LOG;
-
- /**
- * The Mail being adapted.
- */
- private Mail fieldMail;
- /**
- * The MailetContext.
- */
- private MailetContext fieldMailetContext;
- /**
- * List of Actions to perform.
- */
- private List<Action> fieldActions;
-
- private final ActionDispatcher dispatcher;
-
- private final Poster poster;
- private final DateTime scriptActivationDate;
- private final DateTime scriptInterpretationDate;
- private final MailAddress recipient;
-
- /**
- * Constructor for SieveMailAdapter.
- *
- * @param aMail
- * @param aMailetContext
- */
- public SieveMailAdapter(final Mail aMail, final MailetContext aMailetContext, final ActionDispatcher dispatcher, final Poster poster,
- DateTime scriptActivationDate, DateTime scriptInterpretationDate, MailAddress recipient)
- {
- this.poster = poster;
- this.dispatcher = dispatcher;
- this.scriptInterpretationDate = scriptInterpretationDate;
- this.scriptActivationDate = scriptActivationDate;
- this.recipient = recipient;
- setMail(aMail);
- setMailetContext(aMailetContext);
- }
-
- public DateTime getScriptActivationDate() {
- return scriptActivationDate;
- }
-
- public DateTime getScriptInterpretationDate() {
- return scriptInterpretationDate;
- }
-
- public MailAddress getRecipient() {
- return recipient;
- }
-
- public void setLog(Log log) {
- this.log = log;
- }
-
- /**
- * Returns the message.
- *
- * @return MimeMessage
- */
- protected MimeMessage getMessage() throws MessagingException
- {
- return getMail().getMessage();
- }
- /**
- * Returns the List of actions.
- *
- * @return List
- */
- public List<Action> getActions()
- {
- List<Action> actions = null;
- if (null == (actions = getActionsBasic()))
- {
- updateActions();
- return getActions();
- }
- return actions;
- }
- /**
- * Returns a new List of actions.
- *
- * @return List
- */
- protected List<Action> computeActions()
- {
- return new ArrayList<Action>();
- }
- /**
- * Returns the List of actions.
- *
- * @return List
- */
- private List<Action> getActionsBasic()
- {
- return fieldActions;
- }
- /**
- * Adds an Action.
- *
- * @param action The action to set
- */
- public void addAction(Action action)
- {
- getActions().add(action);
- }
- /**
- * @see org.apache.jsieve.mail.MailAdapter#executeActions()
- */
- public void executeActions() throws SieveException
- {
- final List<Action> actions = getActions();
- for (final Action action: actions) {
- getMailetContext().log("Executing action: " + action.toString());
- try
- {
- dispatcher.execute(action, getMail(), this);
- }
- catch (MessagingException e)
- {
- throw new SieveException(e);
- }
- }
- }
- /**
- * Sets the actions.
- *
- * @param actions The actions to set
- */
- protected void setActions(List<Action> actions)
- {
- fieldActions = actions;
- }
-
- /**
- * Updates the actions.
- */
- protected void updateActions()
- {
- setActions(computeActions());
- }
-
- /**
- * @see org.apache.jsieve.mail.MailAdapter#getHeader(String)
- */
- public List<String> getHeader(String name) throws SieveMailException
- {
- try
- {
- String[] headers = getMessage().getHeader(name);
- return (headers == null ? new ArrayList<String>(0) : Arrays.asList(headers));
- }
- catch (MessagingException ex)
- {
- throw new SieveMailException(ex);
- }
- }
-
- /**
- * @see org.apache.jsieve.mail.MailAdapter#getHeaderNames()
- */
- public List<String> getHeaderNames() throws SieveMailException
- {
- Set<String> headerNames = new HashSet<String>();
- try
- {
- Enumeration allHeaders = getMessage().getAllHeaders();
- while (allHeaders.hasMoreElements())
- {
- headerNames.add(((Header) allHeaders.nextElement()).getName());
- }
- return new ArrayList<String>(headerNames);
- }
- catch (MessagingException ex)
- {
- throw new SieveMailException(ex);
- }
- }
-
- /**
- * @see org.apache.jsieve.mail.MailAdapter#getMatchingHeader(String)
- */
- public List<String> getMatchingHeader(String name) throws SieveMailException
- {
- return MailUtils.getMatchingHeader(this, name);
- }
-
- /**
- * @see org.apache.jsieve.mail.MailAdapter#getSize()
- */
- public int getSize() throws SieveMailException
- {
- try
- {
- return (int) getMail().getMessageSize();
- }
- catch (MessagingException ex)
- {
- throw new SieveMailException(ex);
- }
- }
-
- /**
- * Method getEnvelopes.
- *
- * @return Map
- */
- protected Map<String, String> getEnvelopes()
- {
- Map<String, String> envelopes = new HashMap<String, String>(2);
- if (null != getEnvelopeFrom())
- envelopes.put("From", getEnvelopeFrom());
- if (null != getEnvelopeTo())
- envelopes.put("To", getEnvelopeTo());
- return envelopes;
- }
- /**
- * @see org.apache.jsieve.mail.optional.EnvelopeAccessors#getEnvelope(String)
- */
- public List<String> getEnvelope(String name) throws SieveMailException
- {
- List<String> values = new ArrayList<String>(1);
- String value = getEnvelopes().get(name);
- if (null != value)
- values.add(value);
- return values;
- }
-
- /**
- * @see org.apache.jsieve.mail.optional.EnvelopeAccessors#getEnvelopeNames()
- */
- public List<String> getEnvelopeNames() throws SieveMailException
- {
- return new ArrayList<String>(getEnvelopes().keySet());
- }
-
- /**
- * @see org.apache.jsieve.mail.optional.EnvelopeAccessors#getMatchingEnvelope(String)
- */
- public List<String> getMatchingEnvelope(String name) throws SieveMailException
- {
- final List<String> matchedEnvelopeValues = new ArrayList<String>(32);
- for (String envelopeName: getEnvelopeNames()) {
- if (envelopeName.trim().equalsIgnoreCase(name))
- matchedEnvelopeValues.addAll(getEnvelope(envelopeName));
- }
- return matchedEnvelopeValues;
- }
-
- /**
- * Returns the from.
- *
- * @return String
- */
- public String getEnvelopeFrom()
- {
- MailAddress sender = getMail().getSender();
- return (null == sender ? "" : sender.toString());
- }
-
- /**
- * Returns the sole recipient or null if there isn't one.
- *
- * @return String
- */
- public String getEnvelopeTo()
- {
- for (MailAddress mailAddress : getMail().getRecipients()) {
- String recipient = mailAddress.toInternetAddress().getAddress();
- if (recipient != null) {
- return recipient;
- }
- }
- return null;
- }
-
- /**
- * Returns the mail.
- *
- * @return Mail
- */
- public Mail getMail()
- {
- return fieldMail;
- }
-
- /**
- * Sets the mail.
- *
- * @param mail The mail to set
- */
- protected void setMail(Mail mail)
- {
- fieldMail = mail;
- }
-
- /**
- * Returns the mailetContext.
- *
- * @return MailetContext
- */
- public MailetContext getMailetContext()
- {
- return fieldMailetContext;
- }
-
- /**
- * Sets the mailetContext.
- *
- * @param mailetContext The mailetContext to set
- */
- protected void setMailetContext(MailetContext mailetContext)
- {
- fieldMailetContext = mailetContext;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- String messageID = null;
- try
- {
- messageID = getMail().getMessage().getMessageID();
- }
- catch (MessagingException e)
- {
- messageID = "<" + e.getMessage() + ">";
- }
- return getClass().getName() + " Envelope From: "
- + (null == getEnvelopeFrom() ? "null" : getEnvelopeFrom())
- + " Envelope To: "
- + (null == getEnvelopeTo() ? "null" : getEnvelopeTo())
- + " Message ID: " + (null == messageID ? "null" : messageID);
- }
-
- public String getContentType() throws SieveMailException {
- try {
- return getMessage().getContentType();
- } catch (MessagingException e) {
- throw new SieveMailException(e);
- }
- }
-
- public Address[] parseAddresses(String arg) throws SieveMailException, InternetAddressException {
- try {
- List<String> headerValues = getHeader(arg);
- List<MailboxList> mailboxes = new ArrayList<MailboxList>();
- int size = 0;
- for(String headerValue : headerValues) {
- MailboxList mailboxList = new AddressList(DefaultAddressParser.DEFAULT.parseAddressList(headerValue), true).flatten();
- size += mailboxList.size();
- mailboxes.add(mailboxList);
- }
- int i = 0;
- final Address[] results = new Address[size];
- for(MailboxList mailboxList : mailboxes) {
- for(Mailbox mailbox : mailboxList) {
- results[i] = new AddressImpl(mailbox.getLocalPart(), mailbox.getDomain());
- i++;
- }
- }
- return results;
- } catch (ParseException e) {
- throw new InternetAddressException(e);
- }
- }
-
- public Log getLog() {
- return log;
- }
-
- public String getServerInfo() {
- return getMailetContext().getServerInfo();
- }
- public void post(String uri, MimeMessage mail) throws MessagingException {
- poster.post(uri, mail);
- }
-
- public void post(MailAddress sender, Collection recipients, MimeMessage mail) throws MessagingException {
- getMailetContext().sendMail(sender, recipients, mail);
- }
-
- public boolean isInBodyText(List<String> phrasesCaseInsensitive) throws SieveMailException {
- try {
- return MessageMatcher.builder()
- .contentTypes(Lists.newArrayList("text/plain"))
- .includeHeaders(false)
- .caseInsensitive(false)
- .searchContents(Lists.transform(phrasesCaseInsensitive, new Function<String, CharSequence>() {
- public CharSequence apply(String s) {
- return s;
- }
- })).build()
- .messageMatches(getMail().getMessage().getInputStream());
- } catch (Exception e) {
- throw new SieveMailException("Error searching in the mail content", e);
- }
- }
-
- public boolean isInBodyRaw(List<String> phrasesCaseInsensitive) throws SieveMailException {
- try {
- return MessageMatcher.builder()
- .includeHeaders(false)
- .caseInsensitive(false)
- .ignoringMime(true)
- .searchContents(Lists.transform(phrasesCaseInsensitive, new Function<String, CharSequence>() {
- public CharSequence apply(String s) {
- return s;
- }
- })).build()
- .messageMatches(getMail().getMessage().getInputStream());
- } catch (Exception e) {
- throw new SieveMailException("Error searching in the mail content", e);
- }
- }
-
- public boolean isInBodyContent(List<String> contentTypes, List<String> phrasesCaseInsensitive) throws SieveMailException {
- try {
- return MessageMatcher.builder()
- .contentTypes(contentTypes)
- .includeHeaders(false)
- .caseInsensitive(false)
- .searchContents(Lists.transform(phrasesCaseInsensitive, new Function<String, CharSequence>() {
- public CharSequence apply(String s) {
- return s;
- }
- })).build()
- .messageMatches(getMail().getMessage().getInputStream());
- } catch (Exception e) {
- throw new SieveMailException("Error searching in the mail content", e);
- }
- }
-
- public void setContext(SieveContext context) {}
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/SieveMailboxMailet.java b/mailet/src/main/java/org/apache/jsieve/mailet/SieveMailboxMailet.java
deleted file mode 100644
index 5d6d214..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/SieveMailboxMailet.java
+++ /dev/null
@@ -1,464 +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.jsieve.mailet;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.mail.Header;
-import javax.mail.MessagingException;
-import javax.mail.internet.InternetHeaders;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-import org.apache.commons.logging.Log;
-import org.apache.jsieve.ConfigurationManager;
-import org.apache.jsieve.SieveConfigurationException;
-import org.apache.jsieve.SieveFactory;
-import org.apache.jsieve.exception.SieveException;
-import org.apache.jsieve.parser.generated.ParseException;
-import org.apache.jsieve.parser.generated.TokenMgrError;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.mailet.MailetConfig;
-import org.apache.mailet.MailetException;
-import org.apache.mailet.base.GenericMailet;
-import org.apache.mailet.base.RFC2822Headers;
-
-/**
- * <p>Executes a <a href='http://www.rfc-editor.org/rfc/rfc3028.txt'>Sieve</a>
- * script against incoming mail. The script applied is based on the recipient.</p>
- * <h4>Init Parameters</h4>
- * <table>
- * <thead><tr><th>Name</th><th>Required</th><th>Values</th><th>Role</th></thead>
- * <tr><td>verbose</td><td>No - defaults to false</td><td>true (ignoring case) to enable, otherwise disable</td>
- * <td>
- * Enables verbose logging.
- * </td></tr>
- * </table>
- */
-public class SieveMailboxMailet extends GenericMailet {
-
- /**
- * The delivery header
- */
- private String deliveryHeader;
-
- /**
- * resetReturnPath
- */
- private boolean resetReturnPath;
- /** Experimental */
- private Poster poster;
- /** Experimental */
- private ResourceLocator locator;
-
- /** Indicates whether this mailet should log verbosely */
- private boolean verbose = false;
-
- private boolean consume = true;
- /** Indicates whether this mailet should log minimal information */
- private boolean quiet = true;
-
- private SieveFactory factory;
-
- private ActionDispatcher actionDispatcher;
-
- private Log log;
-
- /**
- * For SDI
- */
- public SieveMailboxMailet() {}
-
- /**
- * CDI
- * @param poster not null
- */
- public SieveMailboxMailet(Poster poster, ResourceLocator locator) {
- this();
- this.poster = poster;
- this.locator = locator;
- }
-
-
- public ResourceLocator getLocator() {
- return locator;
- }
-
- /**
- * For SDI
- * @param locator not null
- */
- public void setLocator(ResourceLocator locator) {
- this.locator = locator;
- }
-
- public Poster getPoster() {
- return poster;
- }
-
- /**
- * For SDI
- * @param poster not null
- */
- public void setPoster(Poster poster) {
- this.poster = poster;
- }
-
- /**
- * Is this mailet GHOSTing all mail it processes?
- * @return true when mailet consumes all mail, false otherwise
- */
- public boolean isConsume() {
- return consume;
- }
-
- /**
- * Sets whether this mailet should GHOST all mail.
- * @param consume true when the mailet should consume all mail,
- * false otherwise
- */
- public void setConsume(boolean consume) {
- this.consume = consume;
- }
-
- /**
- * Is this mailet logging verbosely?
- * This property is set by init parameters.
- * @return true if logging should be verbose, false otherwise
- */
- public boolean isVerbose() {
- return verbose;
- }
-
-
- /**
- * Sets whether logging should be verbose for this mailet.
- * This property is set by init parameters.
- * This setting overrides {@link #isQuiet()}.
- * @param verbose true when logging should be verbose,
- * false otherwise
- */
- public void setVerbose(boolean verbose) {
- this.verbose = verbose;
- }
-
- /**
- * Is the logging for this mailet set to minimal?
- * @return true
- */
- public boolean isQuiet() {
- return quiet;
- }
-
- /**
- * Sets the logging for this mailet to minimal.
- * This is overriden by {@link #setVerbose(boolean)}.
- * @param quiet true for minimal logging, false otherwise
- */
- public void setQuiet(boolean quiet) {
- this.quiet = quiet;
- }
-
-
- /**
- * Is informational logging turned on?
- * @return true when minimal logging is off,
- * false when logging is minimal
- */
- public boolean isInfoLoggingOn() {
- return verbose || !quiet;
- }
-
- @Override
- public void init(MailetConfig config) throws MessagingException {
-
- super.init(config);
-
- try {
- final ConfigurationManager configurationManager = new ConfigurationManager();
- final int logLevel;
- if (verbose) {
- logLevel = CommonsLoggingAdapter.TRACE;
- } else if (quiet) {
- logLevel = CommonsLoggingAdapter.FATAL;
- } else {
- logLevel = CommonsLoggingAdapter.WARN;
- }
- log = new CommonsLoggingAdapter(this, logLevel);
- configurationManager.setLog(log);
- factory = configurationManager.build();
- } catch (SieveConfigurationException e) {
- throw new MessagingException("Failed to load standard Sieve configuration.", e);
- }
- }
-
- /**
- * Delivers a mail to a local mailbox.
- *
- * @param mail
- * the mail being processed
- *
- * @throws MessagingException
- * if an error occurs while storing the mail
- */
- @SuppressWarnings("unchecked")
- @Override
- public void service(Mail mail) throws MessagingException {
- Collection<MailAddress> recipients = mail.getRecipients();
- Collection<MailAddress> errors = new Vector<MailAddress>();
-
- MimeMessage message = null;
- if (deliveryHeader != null || resetReturnPath) {
- message = mail.getMessage();
- }
-
- if (resetReturnPath) {
- // Set Return-Path and remove all other Return-Path headers from the
- // message
- // This only works because there is a placeholder inserted by
- // MimeMessageWrapper
- message.setHeader(RFC2822Headers.RETURN_PATH,
- (mail.getSender() == null ? "<>" : "<" + mail.getSender()
- + ">"));
- }
-
- Enumeration headers;
- InternetHeaders deliveredTo = new InternetHeaders();
- if (deliveryHeader != null) {
- // Copy any Delivered-To headers from the message
- headers = message
- .getMatchingHeaders(new String[] { deliveryHeader });
- while (headers.hasMoreElements()) {
- Header header = (Header) headers.nextElement();
- deliveredTo.addHeader(header.getName(), header.getValue());
- }
- }
-
- for (Iterator<MailAddress> i = recipients.iterator(); i.hasNext();) {
- MailAddress recipient = i.next();
- try {
- if (deliveryHeader != null) {
- // Add qmail's de facto standard Delivered-To header
- message.addHeader(deliveryHeader, recipient.toString());
- }
-
- storeMail(mail.getSender(), recipient, mail);
-
- if (deliveryHeader != null) {
- if (i.hasNext()) {
- // Remove headers but leave all placeholders
- message.removeHeader(deliveryHeader);
- headers = deliveredTo.getAllHeaders();
- // And restore any original Delivered-To headers
- while (headers.hasMoreElements()) {
- Header header = (Header) headers.nextElement();
- message.addHeader(header.getName(), header
- .getValue());
- }
- }
- }
- } catch (Exception ex) {
- log("Error while storing mail.", ex);
- errors.add(recipient);
- }
- }
-
- if (!errors.isEmpty()) {
- // If there were errors, we redirect the email to the ERROR
- // processor.
- // In order for this server to meet the requirements of the SMTP
- // specification, mails on the ERROR processor must be returned to
- // the sender. Note that this email doesn't include any details
- // regarding the details of the failure(s).
- // In the future we may wish to address this.
- getMailetContext().sendMail(mail.getSender(), errors,
- mail.getMessage(), Mail.ERROR);
- }
- if (consume) {
- // Consume this message
- mail.setState(Mail.GHOST);
- }
- }
-
- /**
- * Return a string describing this mailet.
- *
- * @return a string describing this mailet
- */
- @Override
- public String getMailetInfo() {
- return "Sieve Mailbox Mailet";
- }
-
- /**
- *
- * @param sender
- * @param recipient
- * @param mail
- * @throws MessagingException
- */
- public void storeMail(MailAddress sender, MailAddress recipient,
- Mail mail) throws MessagingException {
- if (recipient == null) {
- throw new IllegalArgumentException(
- "Recipient for mail to be spooled cannot be null.");
- }
- if (mail.getMessage() == null) {
- throw new IllegalArgumentException(
- "Mail message to be spooled cannot be null.");
- }
-
- sieveMessage(recipient, mail);
-
- }
-
- protected void sieveMessage(MailAddress recipient, Mail aMail) throws MessagingException {
- String username = getUsername(recipient);
- try {
- final ResourceLocator.UserSieveInformation userSieveInformation = locator.get(getScriptUri(recipient));
- sieveMessageEvaluate(recipient, aMail, userSieveInformation);
- } catch (Exception ex) {
- // SIEVE is a mail filtering protocol.
- // Rejecting the mail because it cannot be filtered
- // seems very unfriendly.
- // So just log and store in INBOX
- if (isInfoLoggingOn()) {
- log("Cannot evaluate Sieve script. Storing mail in user INBOX.", ex);
- }
- storeMessageInbox(username, aMail.getMessage());
- }
- }
-
- private void sieveMessageEvaluate(MailAddress recipient, Mail aMail, ResourceLocator.UserSieveInformation userSieveInformation) throws MessagingException, IOException {
- try {
- SieveMailAdapter aMailAdapter = new SieveMailAdapter(aMail,
- getMailetContext(), actionDispatcher, poster, userSieveInformation.getScriptActivationDate(),
- userSieveInformation.getScriptInterpretationDate(), recipient);
- aMailAdapter.setLog(log);
- // This logging operation is potentially costly
- if (verbose) {
- log("Evaluating " + aMailAdapter.toString() + "against \""
- + getScriptUri(recipient) + "\"");
- }
- factory.evaluate(aMailAdapter, factory.parse(userSieveInformation.getScriptContent()));
- } catch (SieveException ex) {
- handleFailure(recipient, aMail, ex);
- }
- catch (ParseException ex) {
- handleFailure(recipient, aMail, ex);
- }
- catch (TokenMgrError ex)
- {
- handleFailure(recipient, aMail, new SieveException(ex));
- }
- }
-
- protected void storeMessageInbox(String username, MimeMessage message) throws MessagingException {
- String url = "mailbox://" + username + "/";
- poster.post(url, message);
- }
-
- /**
- * @see org.apache.mailet.base.GenericMailet#init()
- */
- @Override
- public void init() throws MessagingException {
- super.init();
- if (poster == null || locator == null) {
- throw new MailetException("Not initialised. Please ensure that the mailet container supports either" +
- " setter or constructor injection");
- }
-
- this.deliveryHeader = getInitParameter("addDeliveryHeader");
- this.resetReturnPath = getInitParameter("resetReturnPath", true);
- this.consume = getInitParameter("consume", true);
- this.verbose = getInitParameter("verbose", false);
- this.quiet = getInitParameter("quiet", false);
-
- actionDispatcher = new ActionDispatcher();
- }
-
- /**
- * Return the username to use for sieve processing for the given MailAddress
- *
- * @param m
- * @return username
- */
- protected String getUsername(MailAddress m) {
- return m.getLocalPart() + "@localhost";
- }
-
- /**
- * Return the URI for the sieve script
- *
- * @param m
- * @return
- */
- protected String getScriptUri(MailAddress m) {
- return "//" + getUsername(m) + "/sieve";
- }
-
- /**
- * Deliver the original mail as an attachment with the main part being an error report.
- *
- * @param recipient
- * @param aMail
- * @param ex
- * @throws MessagingException
- * @throws IOException
- */
- protected void handleFailure(MailAddress recipient, Mail aMail, Exception ex)
- throws MessagingException, IOException {
- String user = getUsername(recipient);
-
- MimeMessage originalMessage = aMail.getMessage();
- MimeMessage message = new MimeMessage(originalMessage);
- MimeMultipart multipart = new MimeMultipart();
-
- MimeBodyPart noticePart = new MimeBodyPart();
- noticePart.setText("An error was encountered while processing this mail with the active sieve script for user \""
- + user + "\". The error encountered was:\r\n" + ex.getLocalizedMessage() + "\r\n");
- multipart.addBodyPart(noticePart);
-
- MimeBodyPart originalPart = new MimeBodyPart();
- originalPart.setContent(originalMessage, "message/rfc822");
- if ((originalMessage.getSubject() != null) && (!originalMessage.getSubject().trim().isEmpty())) {
- originalPart.setFileName(originalMessage.getSubject().trim());
- } else {
- originalPart.setFileName("No Subject");
- }
- originalPart.setDisposition(MimeBodyPart.INLINE);
- multipart.addBodyPart(originalPart);
-
- message.setContent(multipart);
- message.setSubject("[SIEVE ERROR] " + originalMessage.getSubject());
- message.setHeader("X-Priority", "1");
- message.saveChanges();
-
- storeMessageInbox(user, message);
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/VacationAction.java b/mailet/src/main/java/org/apache/jsieve/mailet/VacationAction.java
deleted file mode 100644
index 3a1abba..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/VacationAction.java
+++ /dev/null
@@ -1,100 +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.jsieve.mailet;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import org.apache.jsieve.mail.Action;
-import org.apache.jsieve.mail.optional.ActionVacation;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.joda.time.Days;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.AddressException;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-public class VacationAction implements MailAction {
-
- @Override
- public void execute(Action action, Mail mail, ActionContext context) throws MessagingException {
- ActionVacation actionVacation = (ActionVacation) action;
- int dayDifference = Days.daysBetween(context.getScriptActivationDate(), context.getScriptInterpretationDate()).getDays();
- if (isStillInVacation(actionVacation, dayDifference)) {
- if (isValidForReply(mail, actionVacation, context)) {
- if (!isMailingList(mail)) {
- sendVacationNotification(mail, actionVacation, context);
- }
- }
- }
- }
-
- private void sendVacationNotification(Mail mail, ActionVacation actionVacation, ActionContext context) throws MessagingException {
- VacationReply vacationReply = VacationReply.builder(mail, context)
- .from(actionVacation.getFrom())
- .mime(actionVacation.getMime())
- .reason(actionVacation.getReason())
- .subject(actionVacation.getSubject())
- .build();
- context.post(vacationReply.getSender(), vacationReply.getRecipients(), vacationReply.getMimeMessage());
- }
-
- private boolean isStillInVacation(ActionVacation actionVacation, int dayDifference) {
- return dayDifference >= 0 && dayDifference <= actionVacation.getDuration();
- }
-
- private boolean isValidForReply(final Mail mail, ActionVacation actionVacation, final ActionContext context) {
- Set<MailAddress> currentMailAddresses = ImmutableSet.copyOf(mail.getRecipients());
- Set<MailAddress> allowedMailAddresses = ImmutableSet.<MailAddress>builder().addAll(
- Lists.transform(actionVacation.getAddresses(), new Function<String, MailAddress>() {
- public MailAddress apply(String s) {
- return retrieveAddressFromString(s, context);
- }
- }))
- .add(context.getRecipient())
- .build();
- return !Sets.intersection(currentMailAddresses, allowedMailAddresses).isEmpty();
- }
-
- private MailAddress retrieveAddressFromString(String address, ActionContext context) {
- try {
- return new MailAddress(address);
- } catch (AddressException e) {
- context.getLog().warn("Mail address " + address + " was not well formatted : " + e.getLocalizedMessage());
- return null;
- }
- }
-
- private boolean isMailingList(Mail mail) throws MessagingException {
- Enumeration enumeration = mail.getMessage().getAllHeaderLines();
- while (enumeration.hasMoreElements()) {
- String headerName = (String) enumeration.nextElement();
- if (headerName.startsWith("List-")) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/VacationReply.java b/mailet/src/main/java/org/apache/jsieve/mailet/VacationReply.java
deleted file mode 100644
index c15f5d5..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/VacationReply.java
+++ /dev/null
@@ -1,169 +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.jsieve.mailet;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-
-import javax.activation.DataHandler;
-import javax.mail.MessagingException;
-import javax.mail.Multipart;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.util.ByteArrayDataSource;
-import java.io.IOException;
-import java.util.List;
-
-public class VacationReply {
-
-
- public static class Builder {
-
- private final Mail originalMail;
- private final ActionContext context;
- private String from;
- private String reason;
- private String mime;
- private String subject;
-
- public Builder(Mail originalMail, ActionContext context) {
- this.originalMail = originalMail;
- this.context = context;
- }
-
- public Builder from(String from) {
- this.from = from;
- return this;
- }
-
- public Builder reason(String reason) {
- this.reason = reason;
- return this;
- }
-
- public Builder mime(String mime) {
- this.mime = mime;
- return this;
- }
-
- public Builder subject(String subject) {
- this.subject = subject;
- return this;
- }
-
- public VacationReply build() throws MessagingException {
- Preconditions.checkState(eitherReasonOrMime());
- ActionUtils.detectAndHandleLocalLooping(originalMail, context, "vacation");
-
- MimeMessage reply = (MimeMessage) originalMail.getMessage().reply(false);
- reply.setSubject(generateNotificationSubject());
- reply.setContent(generateNotificationContent());
-
- return new VacationReply(retrieveOriginalSender(), Lists.newArrayList(originalMail.getSender()), reply);
- }
-
- private boolean eitherReasonOrMime() {
- return (reason == null) ^ (mime == null);
- }
-
- private String generateNotificationSubject() {
- return Optional.fromNullable(subject)
- .or(context.getRecipient() + " is currently in vacation");
- }
-
- private Multipart generateNotificationContent() throws MessagingException {
- try {
- if (reason != null) {
- return generateNotificationContentFromReasonString();
- } else {
- return generateNotificationContentFromMime();
- }
- } catch (IOException e) {
- throw new MessagingException("Cannot read specified content", e);
- }
- }
-
- private Multipart generateNotificationContentFromMime() throws MessagingException, IOException {
- return new MimeMultipart(new ByteArrayDataSource(mime, "mixed"));
- }
-
- private Multipart generateNotificationContentFromReasonString() throws MessagingException, IOException {
- Multipart multipart = new MimeMultipart("mixed");
- MimeBodyPart reasonPart = new MimeBodyPart();
- reasonPart.setDataHandler(
- new DataHandler(
- new ByteArrayDataSource(
- reason,
- "text/plain; charset=UTF-8")));
- reasonPart.setDisposition(MimeBodyPart.INLINE);
- multipart.addBodyPart(reasonPart);
- return multipart;
- }
-
- private MailAddress retrieveOriginalSender() throws AddressException {
- return Optional.fromNullable(from).transform(new Function<String, MailAddress>() {
- public MailAddress apply(String address) {
- return retrieveAddressFromString(address, context);
- }
- }).or(context.getRecipient());
- }
-
- private MailAddress retrieveAddressFromString(String address, ActionContext context) {
- try {
- return new MailAddress(address);
- } catch (AddressException e) {
- context.getLog().warn("Mail address " + address + " was not well formatted : " + e.getLocalizedMessage());
- return null;
- }
- }
- }
-
- public static Builder builder(Mail originalMail, ActionContext context) {
- return new Builder(originalMail, context);
- }
-
- private final MailAddress sender;
- private final List<MailAddress> recipients;
- private final MimeMessage mimeMessage;
-
- private VacationReply(MailAddress sender, List<MailAddress> recipients, MimeMessage mimeMessage) {
- this.sender = sender;
- this.recipients = recipients;
- this.mimeMessage = mimeMessage;
- }
-
- public MailAddress getSender() {
- return sender;
- }
-
- public List<MailAddress> getRecipients() {
- return recipients;
- }
-
- public MimeMessage getMimeMessage() {
- return mimeMessage;
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeAutomatic.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeAutomatic.java
deleted file mode 100644
index fd9bd47..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeAutomatic.java
+++ /dev/null
@@ -1,42 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ActionModeAutomatic</code>
- */
-public class ActionModeAutomatic implements DispositionActionMode {
-
- /**
- * Default Constructor
- */
- public ActionModeAutomatic() {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "automatic-action";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeManual.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeManual.java
deleted file mode 100644
index 79616d8..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeManual.java
+++ /dev/null
@@ -1,47 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ActionModeManual</code>
- */
-public class ActionModeManual
- implements
- DispositionActionMode
-{
-
- /**
- * Default Constructor
- */
- public ActionModeManual()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "manual-action";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/Disposition.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/Disposition.java
deleted file mode 100644
index 5a39e01..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/Disposition.java
+++ /dev/null
@@ -1,176 +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.jsieve.mailet.mdn;
-
-/**
- * Class <code>Disposition</code> encapsulating
- * disposition information as defined by RFC 2298.
- */
-public class Disposition
-{
- private DispositionActionMode fieldActionMode;
- private DispositionSendingMode fieldSendingMode;
- private DispositionType fieldDispositionType;
- private DispositionModifier[] fieldDispositionModifiers;
-
- /**
- * Default Construcor
- */
- private Disposition()
- {
- super();
- }
-
- /**
- * Constructor.
- *
- * @param actionMode
- * @param sendingMode
- * @param type
- */
- public Disposition(DispositionActionMode actionMode, DispositionSendingMode sendingMode, DispositionType type)
- {
- this();
- setActionMode(actionMode);
- setSendingMode(sendingMode);
- setDispositionType(type);
- }
-
- /**
- * Constructor.
- *
- * @param actionMode
- * @param sendingMode
- * @param type
- * @param modifiers
- */
- public Disposition(DispositionActionMode actionMode, DispositionSendingMode sendingMode, DispositionType type,
- DispositionModifier[] modifiers)
- {
- this(actionMode, sendingMode, type);
- setDispositionModifiers(modifiers);
- }
-
- /**
- * Answer the Disposition Mode.
- *
- * @return Returns the dispostionMode.
- */
- protected DispositionActionMode getActionMode()
- {
- return fieldActionMode;
- }
-
- /**
- * Set the Disposition Mode.
- *
- * @param dispostionMode The dispostionMode to set.
- */
- protected void setActionMode(DispositionActionMode dispostionMode)
- {
- fieldActionMode = dispostionMode;
- }
-
- /**
- * Answer the Disposition Modifiers.
- *
- * @return Returns the dispostionModifiers.
- */
- protected DispositionModifier[] getDispositionModifiers()
- {
- return fieldDispositionModifiers;
- }
-
- /**
- * Set the Disposition Modifiers.
- *
- * @param dispostionModifiers The dispostionModifiers to set.
- */
- protected void setDispositionModifiers(DispositionModifier[] dispostionModifiers)
- {
- fieldDispositionModifiers = dispostionModifiers;
- }
-
- /**
- * Answer the Disposition Type.
- *
- * @return Returns the dispostionType.
- */
- protected DispositionType getDispositionType()
- {
- return fieldDispositionType;
- }
-
- /**
- * Set the Disposition Type.
- *
- * @param dispostionType The dispostionType to set.
- */
- protected void setDispositionType(DispositionType dispostionType)
- {
- fieldDispositionType = dispostionType;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuilder builder = new StringBuilder(64);
- builder.append("Disposition: ");
- builder.append(getActionMode() == null ? "" : getActionMode().toString());
- builder.append('/');
- builder.append(getSendingMode() == null ? "" : getSendingMode().toString());
- builder.append(';');
- builder.append(getDispositionType() == null ? "" : getDispositionType().toString());
- if (null != getDispositionModifiers()
- && getDispositionModifiers().length > 0)
- {
- builder.append('/');
- for (int i = 0; i < getDispositionModifiers().length; i++)
- {
- if (i > 0)
- builder.append(',');
- builder.append(getDispositionModifiers()[i]);
- }
- }
- return builder.toString();
- }
-
- /**
- * Answer the Sending Mode.
- *
- * @return Returns the sendingMode.
- */
- protected DispositionSendingMode getSendingMode()
- {
- return fieldSendingMode;
- }
-
- /**
- * Set the Sending Mode.
- *
- * @param sendingMode The sendingMode to set.
- */
- protected void setSendingMode(DispositionSendingMode sendingMode)
- {
- fieldSendingMode = sendingMode;
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionActionMode.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionActionMode.java
deleted file mode 100644
index 95b883f..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionActionMode.java
+++ /dev/null
@@ -1,29 +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.jsieve.mailet.mdn;
-
-/**
- * Interface <code>DispositionActionMode</code> marks a type encapsulating
- * disposition action mode information as defined by RFC 2298.
- */
-public interface DispositionActionMode
-{
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionModifier.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionModifier.java
deleted file mode 100644
index 25bf06e..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionModifier.java
+++ /dev/null
@@ -1,29 +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.jsieve.mailet.mdn;
-
-/**
- * Interface <code>DispositionModifier</code> marks a type encapsulating
- * disposition modifier information as defined by RFC 2298.
- */
-public interface DispositionModifier
-{
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionSendingMode.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionSendingMode.java
deleted file mode 100644
index 5b29b93..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionSendingMode.java
+++ /dev/null
@@ -1,29 +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.jsieve.mailet.mdn;
-
-/**
- * Interface <code>DispositionSendingMode</code> marks a type encapsulating
- * disposition sending mode information as defined by RFC 2298.
- */
-public interface DispositionSendingMode
-{
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionType.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionType.java
deleted file mode 100644
index 9c17de0..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionType.java
+++ /dev/null
@@ -1,29 +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.jsieve.mailet.mdn;
-
-/**
- * Interface <code>DispositionType</code> marks a type encapsulating
- * disposition type information as defined by RFC 2298.
- */
-public interface DispositionType
-{
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/MDNFactory.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/MDNFactory.java
deleted file mode 100644
index 0b514b2..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/MDNFactory.java
+++ /dev/null
@@ -1,115 +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.jsieve.mailet.mdn;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeBodyPart;
-
-import org.apache.mailet.base.mail.MimeMultipartReport;
-
-/**
- * Class <code>MDNFactory</code> creates MimeMultipartReports containing
- * Message Delivery Notifications as specified by RFC 2298.
- */
-public class MDNFactory
-{
-
- /**
- * Default Constructor
- */
- private MDNFactory()
- {
- super();
- }
-
- /**
- * Answers a MimeMultipartReport containing a
- * Message Delivery Notification as specified by RFC 2298.
- *
- * @param humanText
- * @param reporting_UA_name
- * @param reporting_UA_product
- * @param original_recipient
- * @param final_recipient
- * @param original_message_id
- * @param disposition
- * @return MimeMultipartReport
- * @throws MessagingException
- */
- static public MimeMultipartReport create(String humanText,
- String reporting_UA_name,
- String reporting_UA_product,
- String original_recipient,
- String final_recipient,
- String original_message_id,
- Disposition disposition) throws MessagingException
- {
- // Create the message parts. According to RFC 2298, there are two
- // compulsory parts and one optional part...
- MimeMultipartReport multiPart = new MimeMultipartReport();
- multiPart.setReportType("disposition-notification");
-
- // Part 1: The 'human-readable' part
- MimeBodyPart humanPart = new MimeBodyPart();
- humanPart.setText(humanText);
- multiPart.addBodyPart(humanPart);
-
- // Part 2: MDN Report Part
- // 1) reporting-ua-field
- StringBuilder mdnReport = new StringBuilder(128);
- mdnReport.append("Reporting-UA: ");
- mdnReport.append((reporting_UA_name == null ? "" : reporting_UA_name));
- mdnReport.append("; ");
- mdnReport.append((reporting_UA_product == null ? "" : reporting_UA_product));
- mdnReport.append("\r\n");
- // 2) original-recipient-field
- if (null != original_recipient)
- {
- mdnReport.append("Original-Recipient: ");
- mdnReport.append("rfc822; ");
- mdnReport.append(original_recipient);
- mdnReport.append("\r\n");
- }
- // 3) final-recipient-field
- mdnReport.append("Final-Recepient: ");
- mdnReport.append("rfc822; ");
- mdnReport.append((final_recipient == null ? "" : final_recipient));
- mdnReport.append("\r\n");
- // 4) original-message-id-field
- mdnReport.append("Original-Message-ID: ");
- mdnReport.append((original_message_id == null ? "" : original_message_id));
- mdnReport.append("\r\n");
- // 5) disposition-field
- mdnReport.append(disposition.toString());
- mdnReport.append("\r\n");
- MimeBodyPart mdnPart = new MimeBodyPart();
- mdnPart.setContent(mdnReport.toString(), "message/disposition-notification");
- multiPart.addBodyPart(mdnPart);
-
- // Part 3: The optional third part, the original message is omitted.
- // We don't want to propogate over-sized, virus infected or
- // other undesirable mail!
- // There is the option of adding a Text/RFC822-Headers part, which
- // includes only the RFC 822 headers of the failed message. This is
- // described in RFC 1892. It would be a useful addition!
- return multiPart;
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierError.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierError.java
deleted file mode 100644
index c582e5c..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierError.java
+++ /dev/null
@@ -1,44 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ModifierError</code>
- */
-public class ModifierError implements DispositionModifier
-{
-
- /**
- * Default Constructor
- */
- public ModifierError()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "error";
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierExpired.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierExpired.java
deleted file mode 100644
index 880a700..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierExpired.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ModifierExpired</code>
- */
-public class ModifierExpired implements DispositionModifier
-{
-
- /**
- * Default Constructor
- */
- public ModifierExpired()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "expired";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierFailed.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierFailed.java
deleted file mode 100644
index 741d77e..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierFailed.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ModifierFailed</code>
- */
-public class ModifierFailed implements DispositionModifier
-{
-
- /**
- * Default Constructor
- */
- public ModifierFailed()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "failed";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierMailboxTerminated.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierMailboxTerminated.java
deleted file mode 100644
index 7d715c5..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierMailboxTerminated.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ModifierMailboxTerminated</code>
- */
-public class ModifierMailboxTerminated implements DispositionModifier
-{
-
- /**
- * Default Constructor
- */
- public ModifierMailboxTerminated()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "mailbox-terminated";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierSuperseded.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierSuperseded.java
deleted file mode 100644
index ab8375e..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierSuperseded.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ModifierSuperseded</code>
- */
-public class ModifierSuperseded implements DispositionModifier
-{
-
- /**
- * Default Constructor
- */
- public ModifierSuperseded()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "superseded";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierWarning.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierWarning.java
deleted file mode 100644
index dd0f5d1..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierWarning.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>ModifierWarning</code>
- */
-public class ModifierWarning implements DispositionModifier
-{
-
- /**
- * Default Constructor
- */
- public ModifierWarning()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "warning";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeAutomatic.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeAutomatic.java
deleted file mode 100644
index 9a178b9..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeAutomatic.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>SendingModeAutomatic</code>
- */
-public class SendingModeAutomatic implements DispositionSendingMode
-{
-
- /**
- * Default Constructor
- */
- public SendingModeAutomatic()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "MDN-sent-automatically";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeManual.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeManual.java
deleted file mode 100644
index f123dc6..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeManual.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>SendingModeManual</code>
- */
-public class SendingModeManual implements DispositionSendingMode
-{
-
- /**
- * Default Constructor
- */
- public SendingModeManual()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "MDN-sent-manually";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDeleted.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDeleted.java
deleted file mode 100644
index 9e0a195..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDeleted.java
+++ /dev/null
@@ -1,45 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>TypeDeleted</code>
- */
-public class TypeDeleted implements DispositionType
-{
-
- /**
- * Default Constructor
- */
- public TypeDeleted()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "deleted";
- }
-
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDenied.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDenied.java
deleted file mode 100644
index a08183c..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDenied.java
+++ /dev/null
@@ -1,44 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>TypeDenied</code>
- */
-public class TypeDenied implements DispositionType
-{
-
- /**
- * Default Constructor
- */
- public TypeDenied()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "denied";
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDispatched.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDispatched.java
deleted file mode 100644
index 5c41482..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDispatched.java
+++ /dev/null
@@ -1,43 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>TypeDispatched</code>
- */
-public class TypeDispatched implements DispositionType
-{
- /**
- * Default Constructor
- */
- public TypeDispatched()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "dispatched";
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDisplayed.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDisplayed.java
deleted file mode 100644
index f5f4032..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDisplayed.java
+++ /dev/null
@@ -1,44 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>TypeDisplayed</code>
- */
-public class TypeDisplayed implements DispositionType
-{
-
- /**
- * Default Constructor
- */
- public TypeDisplayed()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "displayed";
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeFailed.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeFailed.java
deleted file mode 100644
index 18f1142..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeFailed.java
+++ /dev/null
@@ -1,44 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>TypeFailed</code>
- */
-public class TypeFailed implements DispositionType
-{
-
- /**
- * Default Constructor
- */
- public TypeFailed()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "failed";
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeProcessed.java b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeProcessed.java
deleted file mode 100644
index d3b0566..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeProcessed.java
+++ /dev/null
@@ -1,44 +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.jsieve.mailet.mdn;
-
-
-/**
- * Class <code>TypeProcessed</code>
- */
-public class TypeProcessed implements DispositionType
-{
-
- /**
- * Default Constructor
- */
- public TypeProcessed()
- {
- super();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "processed";
- }
-}
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/package.html b/mailet/src/main/java/org/apache/jsieve/mailet/mdn/package.html
deleted file mode 100644
index fd5ae70..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/mdn/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<HEAD>
-<!--
-
- @(#)package.html
-
- 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.
--->
-
-</HEAD>
-<BODY>
-
-<p><abbr title='Message Delivery Notifications'>MDN</abbr>
-for JavaMail.</p>
-</BODY>
-</HTML>
\ No newline at end of file
diff --git a/mailet/src/main/java/org/apache/jsieve/mailet/package.html b/mailet/src/main/java/org/apache/jsieve/mailet/package.html
deleted file mode 100644
index 4e499ac..0000000
--- a/mailet/src/main/java/org/apache/jsieve/mailet/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<HEAD>
-<!--
-
- @(#)package.html
-
- 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.
--->
-
-</HEAD>
-<BODY>
-
-<p>Sieve filtering mailet.</p>
-<p>Provides suitable actions and adapters for Sieve use in a <a href='http://james.apache.org/mailet'>Mailet</a> container.</p>
-</BODY>
-</HTML>
\ No newline at end of file
diff --git a/mailet/src/main/resources/sieveConfig.xml b/mailet/src/main/resources/sieveConfig.xml
deleted file mode 100644
index c73c06f..0000000
--- a/mailet/src/main/resources/sieveConfig.xml
+++ /dev/null
@@ -1,142 +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.
- -->
-<!-- Sieve configuration. -->
-<sieve>
- <!-- Declare supported command mappings -->
- <commandMap>
- <!-- Condition Commands -->
- <!-- RFC3082 - Implementations MUST support these: -->
- <entry>
- <name>if</name>
- <class>org.apache.jsieve.commands.If</class>
- </entry>
- <entry>
- <name>else</name>
- <class>org.apache.jsieve.commands.Else</class>
- </entry>
- <entry>
- <name>elsif</name>
- <class>org.apache.jsieve.commands.Elsif</class>
- </entry>
- <entry>
- <name>require</name>
- <class>org.apache.jsieve.commands.Require</class>
- </entry>
- <entry>
- <name>stop</name>
- <class>org.apache.jsieve.commands.Stop</class>
- </entry>
-
- <!-- Action Commands -->
- <!-- RFC3082 - Implementations MUST support these: -->
- <entry>
- <name>keep</name>
- <class>org.apache.jsieve.commands.Keep</class>
- </entry>
- <entry>
- <name>discard</name>
- <class>org.apache.jsieve.commands.Discard</class>
- </entry>
- <entry>
- <name>redirect</name>
- <class>org.apache.jsieve.commands.Redirect</class>
- </entry>
- <!-- RFC3082 - Implementations SHOULD support these: -->
- <entry>
- <name>reject</name>
- <class>org.apache.jsieve.commands.optional.Reject</class>
- </entry>
- <entry>
- <name>fileinto</name>
- <class>org.apache.jsieve.commands.optional.FileInto</class>
- </entry>
-
- <!-- JUnit Commands for Testing -->
- <entry>
- <name>throwtestexception</name>
- <class>org.apache.jsieve.junit.commands.ThrowTestException</class>
- </entry>
-
- <!-- Extension Commands -->
- <entry>
- <name>log</name>
- <class>org.apache.jsieve.commands.extensions.Log</class>
- </entry>
- </commandMap>
-
- <!-- Declare supported test mappings -->
- <testMap>
- <!-- RFC3082 - Implementations MUST support these tests: -->
- <entry>
- <name>address</name>
- <class>org.apache.jsieve.tests.Address</class>
- </entry>
- <entry>
- <name>allof</name>
- <class>org.apache.jsieve.tests.AllOf</class>
- </entry>
- <entry>
- <name>anyof</name>
- <class>org.apache.jsieve.tests.AnyOf</class>
- </entry>
- <entry>
- <name>exists</name>
- <class>org.apache.jsieve.tests.Exists</class>
- </entry>
- <entry>
- <name>false</name>
- <class>org.apache.jsieve.tests.False</class>
- </entry>
- <entry>
- <name>header</name>
- <class>org.apache.jsieve.tests.Header</class>
- </entry>
- <entry>
- <name>not</name>
- <class>org.apache.jsieve.tests.Not</class>
- </entry>
- <entry>
- <name>size</name>
- <class>org.apache.jsieve.tests.Size</class>
- </entry>
- <entry>
- <name>true</name>
- <class>org.apache.jsieve.tests.True</class>
- </entry>
-
- <!-- RFC3082 - Implementations SHOULD support these: -->
- <entry>
- <name>envelope</name>
- <class>org.apache.jsieve.tests.optional.Envelope</class>
- </entry>
- </testMap>
-
- <!-- Declare supported comparator mappings -->
- <comparatorMap>
- <!-- RFC3082 - Implementations MUST support these: -->
- <entry>
- <name>i;octet</name>
- <class>org.apache.jsieve.comparators.Octet</class>
- </entry>
- <entry>
- <name>i;ascii-casemap</name>
- <class>org.apache.jsieve.comparators.AsciiCasemap</class>
- </entry>
- </comparatorMap>
-</sieve>
diff --git a/mailet/src/reporting-site/site.xml b/mailet/src/reporting-site/site.xml
deleted file mode 100644
index d919164..0000000
--- a/mailet/src/reporting-site/site.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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 name="${project.name}">
-
- <body>
-
- <menu ref="parent" />
- <menu ref="reports" />
-
- </body>
-
-</project>
diff --git a/mailet/src/site/resources/images/asf-logo-reduced.gif b/mailet/src/site/resources/images/asf-logo-reduced.gif
deleted file mode 100644
index 93cc102..0000000
--- a/mailet/src/site/resources/images/asf-logo-reduced.gif
+++ /dev/null
Binary files differ
diff --git a/mailet/src/site/resources/images/james-jsieve-logo.gif b/mailet/src/site/resources/images/james-jsieve-logo.gif
deleted file mode 100644
index 9c7e34f..0000000
--- a/mailet/src/site/resources/images/james-jsieve-logo.gif
+++ /dev/null
Binary files differ
diff --git a/mailet/src/site/site.xml b/mailet/src/site/site.xml
deleted file mode 100644
index 85f3beb..0000000
--- a/mailet/src/site/site.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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 name="jSieve">
-
- <body>
-
- <menu name="jSieve Mailet">
- <item name="Overview" href="index.html"/>
- <item name='Catalog' href='mailet-report.html'/>
- <item
- name="Technical Reports"
- href="https://builds.apache.org/hudson/view/G-L/view/James/job/jsieve-trunk/site/mailet/index.html" />
- <item
- name="DOAP"
- href="doap_apache-jsieve-mailet.rdf"
- img='http://www.w3.org/RDF/icons/rdf_metadata_button.32'/>
- </menu>
-
- </body>
-</project>
diff --git a/mailet/src/site/xdoc/index.xml b/mailet/src/site/xdoc/index.xml
deleted file mode 100644
index c3a8ebc..0000000
--- a/mailet/src/site/xdoc/index.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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.
--->
-<document>
-
- <properties>
- <title>Overview</title>
- <author email="jsieve-dev@jakarta.apache.org">jSieve Project</author>
- </properties>
-
-<body>
-<section name="What is jSieve?">
-<p>
-jSieve is a Java implementation of the Sieve mail filtering language defined by
-<a href='http://www.rfc-editor.org/rfc/rfc3028.txt'>RFC 3028</a>. jSieve is implemented
-as a language processor that can be plugged into any internet mail application to add
-Sieve support.
-</p>
-<subsection name='Sieve Mailets'>
-<p>
-This library contains mailets which allow Sieve filters to be easily fitting
-into any enterprise mail server supporting the
-<a href='http://james.apache.org/mailet' rel='tag'>Mailet API</a>. This library
-supplies Sieve mail filtering support for James.
-</p><p>
-For more details, see the <a href='mailet-report.html'>Catelog</a>.
-</p>
-</subsection>
-</section>
-</body>
-</document>
diff --git a/pom.xml b/pom.xml
index e4e3ec2..c082090 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,6 @@
<modules>
<module>all</module>
<module>core</module>
- <module>mailet</module>
<module>util</module>
</modules>
@@ -79,7 +78,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mime4j.version>0.8.0</mime4j.version>
- <apache-mailet.version>2.5.2</apache-mailet.version>
<junit.version>4.10</junit.version>
<jmock.version>1.2.0</jmock.version>
<log4j.version>1.2.14</log4j.version>
@@ -117,32 +115,6 @@
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
- <artifactId>apache-mailet-api</artifactId>
- <version>${apache-mailet.version}</version>
- <exclusions>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.james</groupId>
- <artifactId>apache-mailet-base</artifactId>
- <version>${apache-mailet.version}</version>
- <exclusions>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-core</artifactId>
<version>${mime4j.version}</version>
</dependency>
@@ -245,15 +217,6 @@
</dependencies>
<build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.james</groupId>
- <artifactId>maven-mailetdocs-plugin</artifactId>
- <version>0.1</version>
- </plugin>
- </plugins>
- </pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
diff --git a/src/site/site.xml b/src/site/site.xml
index ac87b98..632596d 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -29,7 +29,6 @@
<body>
<menu name="jSieve">
<item name="Core" href="http://james.apache.org/jsieve/core/index.html" />
- <item name="Mailet" href="http://james.apache.org/jsieve/mailet/index.html" />
<item name="Util" href="http://james.apache.org/jsieve/util/index.html" />
<item name="Changes" href="http://james.apache.org/jsieve/jira-report.html" />
<item name="Release Notes" href="http://james.apache.org/jsieve/release-notes.html" />
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index f42f336..03f0621 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -41,20 +41,13 @@
<a href='mail-lists.html'>mailing lists</a>
.
</p>
- <p>jSieve consists of three products:</p>
+ <p>jSieve consists of two products:</p>
<ol>
<li>
<a href='core/index.html'>Apache JSieve</a>
is a Sieve library coded in Java.
</li>
<li>
- <a href='mailet/index.html'>Apache JSieve Mailet</a>
- is a
- <a href='http://james.apache.org/mailet'>Mailet</a>
- which builds on the JSieve library to create a comprehensive
- server side Sieve filtering system.
- </li>
- <li>
<a href='util/index.html'>Apache JSieve Utilities</a>
contains utility classes helpful when using Sieve but not
considered sufficiently core to be included in the main