JAMES-2132 moving MDN to a separated project
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/976a3037 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/976a3037 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/976a3037 Branch: refs/heads/master Commit: 976a303759c6819db674a21f02e24ea352c6f6a4 Parents: 6553f4b Author: benwa <btell...@linagora.com> Authored: Mon Aug 28 10:46:48 2017 +0700 Committer: benwa <btell...@linagora.com> Committed: Thu Aug 31 18:00:19 2017 +0700 ---------------------------------------------------------------------- mdn/pom.xml | 44 +++++ .../apache/james/mdn/ActionModeAutomatic.java | 42 +++++ .../org/apache/james/mdn/ActionModeManual.java | 47 +++++ .../java/org/apache/james/mdn/Disposition.java | 176 +++++++++++++++++++ .../apache/james/mdn/DispositionActionMode.java | 29 +++ .../apache/james/mdn/DispositionModifier.java | 29 +++ .../james/mdn/DispositionSendingMode.java | 29 +++ .../org/apache/james/mdn/DispositionType.java | 29 +++ .../java/org/apache/james/mdn/MDNFactory.java | 115 ++++++++++++ .../org/apache/james/mdn/ModifierError.java | 44 +++++ .../org/apache/james/mdn/ModifierExpired.java | 45 +++++ .../org/apache/james/mdn/ModifierFailed.java | 45 +++++ .../james/mdn/ModifierMailboxTerminated.java | 45 +++++ .../apache/james/mdn/ModifierSuperseded.java | 45 +++++ .../org/apache/james/mdn/ModifierWarning.java | 45 +++++ .../apache/james/mdn/SendingModeAutomatic.java | 45 +++++ .../org/apache/james/mdn/SendingModeManual.java | 45 +++++ .../java/org/apache/james/mdn/TypeDeleted.java | 45 +++++ .../java/org/apache/james/mdn/TypeDenied.java | 44 +++++ .../org/apache/james/mdn/TypeDispatched.java | 43 +++++ .../org/apache/james/mdn/TypeDisplayed.java | 44 +++++ .../java/org/apache/james/mdn/TypeFailed.java | 44 +++++ .../org/apache/james/mdn/TypeProcessed.java | 44 +++++ pom.xml | 6 + server/mailet/mailets/pom.xml | 4 + .../transport/mailets/jsieve/RejectAction.java | 15 +- .../mailets/jsieve/mdn/ActionModeAutomatic.java | 42 ----- .../mailets/jsieve/mdn/ActionModeManual.java | 47 ----- .../mailets/jsieve/mdn/Disposition.java | 176 ------------------- .../jsieve/mdn/DispositionActionMode.java | 29 --- .../mailets/jsieve/mdn/DispositionModifier.java | 29 --- .../jsieve/mdn/DispositionSendingMode.java | 29 --- .../mailets/jsieve/mdn/DispositionType.java | 29 --- .../mailets/jsieve/mdn/MDNFactory.java | 115 ------------ .../mailets/jsieve/mdn/ModifierError.java | 44 ----- .../mailets/jsieve/mdn/ModifierExpired.java | 45 ----- .../mailets/jsieve/mdn/ModifierFailed.java | 45 ----- .../jsieve/mdn/ModifierMailboxTerminated.java | 45 ----- .../mailets/jsieve/mdn/ModifierSuperseded.java | 45 ----- .../mailets/jsieve/mdn/ModifierWarning.java | 45 ----- .../jsieve/mdn/SendingModeAutomatic.java | 45 ----- .../mailets/jsieve/mdn/SendingModeManual.java | 45 ----- .../mailets/jsieve/mdn/TypeDeleted.java | 45 ----- .../mailets/jsieve/mdn/TypeDenied.java | 44 ----- .../mailets/jsieve/mdn/TypeDispatched.java | 43 ----- .../mailets/jsieve/mdn/TypeDisplayed.java | 44 ----- .../mailets/jsieve/mdn/TypeFailed.java | 44 ----- .../mailets/jsieve/mdn/TypeProcessed.java | 44 ----- 48 files changed, 1181 insertions(+), 1126 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/pom.xml ---------------------------------------------------------------------- diff --git a/mdn/pom.xml b/mdn/pom.xml new file mode 100644 index 0000000..39f58a9 --- /dev/null +++ b/mdn/pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>james-project</artifactId> + <groupId>org.apache.james</groupId> + <version>3.1.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>james-mdn</artifactId> + + + <name>Apache James :: MDN</name> + <description>Provides parser and representations for MDN messages</description> + + <dependencies> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-mailet-base</artifactId> + </dependency> + </dependencies> + + +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ActionModeAutomatic.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ActionModeAutomatic.java b/mdn/src/main/java/org/apache/james/mdn/ActionModeAutomatic.java new file mode 100644 index 0000000..31bdf91 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ActionModeAutomatic.java @@ -0,0 +1,42 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ActionModeManual.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ActionModeManual.java b/mdn/src/main/java/org/apache/james/mdn/ActionModeManual.java new file mode 100644 index 0000000..ab71030 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ActionModeManual.java @@ -0,0 +1,47 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/Disposition.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/Disposition.java b/mdn/src/main/java/org/apache/james/mdn/Disposition.java new file mode 100644 index 0000000..b74ef4d --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/Disposition.java @@ -0,0 +1,176 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/DispositionActionMode.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/DispositionActionMode.java b/mdn/src/main/java/org/apache/james/mdn/DispositionActionMode.java new file mode 100644 index 0000000..969f31f --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/DispositionActionMode.java @@ -0,0 +1,29 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mdn; + +/** + * Interface <code>DispositionActionMode</code> marks a type encapsulating + * disposition action mode information as defined by RFC 2298. + */ +public interface DispositionActionMode +{ + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/DispositionModifier.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/DispositionModifier.java b/mdn/src/main/java/org/apache/james/mdn/DispositionModifier.java new file mode 100644 index 0000000..041b525 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/DispositionModifier.java @@ -0,0 +1,29 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mdn; + +/** + * Interface <code>DispositionModifier</code> marks a type encapsulating + * disposition modifier information as defined by RFC 2298. + */ +public interface DispositionModifier +{ + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/DispositionSendingMode.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/DispositionSendingMode.java b/mdn/src/main/java/org/apache/james/mdn/DispositionSendingMode.java new file mode 100644 index 0000000..2f3e815 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/DispositionSendingMode.java @@ -0,0 +1,29 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mdn; + +/** + * Interface <code>DispositionSendingMode</code> marks a type encapsulating + * disposition sending mode information as defined by RFC 2298. + */ +public interface DispositionSendingMode +{ + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/DispositionType.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/DispositionType.java b/mdn/src/main/java/org/apache/james/mdn/DispositionType.java new file mode 100644 index 0000000..af2dacd --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/DispositionType.java @@ -0,0 +1,29 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mdn; + +/** + * Interface <code>DispositionType</code> marks a type encapsulating + * disposition type information as defined by RFC 2298. + */ +public interface DispositionType +{ + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/MDNFactory.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/MDNFactory.java b/mdn/src/main/java/org/apache/james/mdn/MDNFactory.java new file mode 100644 index 0000000..bc3312f --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/MDNFactory.java @@ -0,0 +1,115 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ModifierError.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ModifierError.java b/mdn/src/main/java/org/apache/james/mdn/ModifierError.java new file mode 100644 index 0000000..b1692f8 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ModifierError.java @@ -0,0 +1,44 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ModifierExpired.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ModifierExpired.java b/mdn/src/main/java/org/apache/james/mdn/ModifierExpired.java new file mode 100644 index 0000000..9d7c678 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ModifierExpired.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ModifierFailed.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ModifierFailed.java b/mdn/src/main/java/org/apache/james/mdn/ModifierFailed.java new file mode 100644 index 0000000..b2a7fe0 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ModifierFailed.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ModifierMailboxTerminated.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ModifierMailboxTerminated.java b/mdn/src/main/java/org/apache/james/mdn/ModifierMailboxTerminated.java new file mode 100644 index 0000000..0c0d10d --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ModifierMailboxTerminated.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ModifierSuperseded.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ModifierSuperseded.java b/mdn/src/main/java/org/apache/james/mdn/ModifierSuperseded.java new file mode 100644 index 0000000..dfeabfb --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ModifierSuperseded.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/ModifierWarning.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/ModifierWarning.java b/mdn/src/main/java/org/apache/james/mdn/ModifierWarning.java new file mode 100644 index 0000000..95cbe4f --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/ModifierWarning.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/SendingModeAutomatic.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/SendingModeAutomatic.java b/mdn/src/main/java/org/apache/james/mdn/SendingModeAutomatic.java new file mode 100644 index 0000000..c716628 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/SendingModeAutomatic.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/SendingModeManual.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/SendingModeManual.java b/mdn/src/main/java/org/apache/james/mdn/SendingModeManual.java new file mode 100644 index 0000000..a86a71e --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/SendingModeManual.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/TypeDeleted.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/TypeDeleted.java b/mdn/src/main/java/org/apache/james/mdn/TypeDeleted.java new file mode 100644 index 0000000..4c6d30a --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/TypeDeleted.java @@ -0,0 +1,45 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/TypeDenied.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/TypeDenied.java b/mdn/src/main/java/org/apache/james/mdn/TypeDenied.java new file mode 100644 index 0000000..eddab50 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/TypeDenied.java @@ -0,0 +1,44 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/TypeDispatched.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/TypeDispatched.java b/mdn/src/main/java/org/apache/james/mdn/TypeDispatched.java new file mode 100644 index 0000000..a814c24 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/TypeDispatched.java @@ -0,0 +1,43 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/TypeDisplayed.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/TypeDisplayed.java b/mdn/src/main/java/org/apache/james/mdn/TypeDisplayed.java new file mode 100644 index 0000000..d82589e --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/TypeDisplayed.java @@ -0,0 +1,44 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/TypeFailed.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/TypeFailed.java b/mdn/src/main/java/org/apache/james/mdn/TypeFailed.java new file mode 100644 index 0000000..8d6ba3d --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/TypeFailed.java @@ -0,0 +1,44 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/mdn/src/main/java/org/apache/james/mdn/TypeProcessed.java ---------------------------------------------------------------------- diff --git a/mdn/src/main/java/org/apache/james/mdn/TypeProcessed.java b/mdn/src/main/java/org/apache/james/mdn/TypeProcessed.java new file mode 100644 index 0000000..b377c86 --- /dev/null +++ b/mdn/src/main/java/org/apache/james/mdn/TypeProcessed.java @@ -0,0 +1,44 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.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"; + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 9e229bf..20ddced 100644 --- a/pom.xml +++ b/pom.xml @@ -527,6 +527,7 @@ <module>backends-common</module> <module>mailbox</module> <module>mailet</module> + <module>mdn</module> <module>metrics</module> <module>mpt</module> <module>protocols</module> @@ -944,6 +945,11 @@ </dependency> <dependency> <groupId>${project.groupId}</groupId> + <artifactId>james-mdn</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> <artifactId>james-server-cassandra-guice</artifactId> <version>${project.version}</version> </dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/pom.xml ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml index bf5dda9..4f3164f 100644 --- a/server/mailet/mailets/pom.xml +++ b/server/mailet/mailets/pom.xml @@ -96,6 +96,10 @@ </dependency> <dependency> <groupId>${project.groupId}</groupId> + <artifactId>james-mdn</artifactId> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> <artifactId>james-server-core</artifactId> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java index 2cd5dc0..460f9f7 100644 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java +++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/RejectAction.java @@ -29,13 +29,14 @@ import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; -import org.apache.james.transport.mailets.jsieve.mdn.ActionModeAutomatic; -import org.apache.james.transport.mailets.jsieve.mdn.Disposition; -import org.apache.james.transport.mailets.jsieve.mdn.DispositionModifier; -import org.apache.james.transport.mailets.jsieve.mdn.MDNFactory; -import org.apache.james.transport.mailets.jsieve.mdn.ModifierError; -import org.apache.james.transport.mailets.jsieve.mdn.SendingModeAutomatic; -import org.apache.james.transport.mailets.jsieve.mdn.TypeDeleted; + +import org.apache.james.mdn.ActionModeAutomatic; +import org.apache.james.mdn.Disposition; +import org.apache.james.mdn.DispositionModifier; +import org.apache.james.mdn.MDNFactory; +import org.apache.james.mdn.ModifierError; +import org.apache.james.mdn.SendingModeAutomatic; +import org.apache.james.mdn.TypeDeleted; import org.apache.jsieve.mail.Action; import org.apache.jsieve.mail.ActionReject; import org.apache.mailet.Mail; http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeAutomatic.java deleted file mode 100644 index 30f6df7..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ActionModeManual.java deleted file mode 100644 index 6d553e1..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/Disposition.java deleted file mode 100644 index e047d66..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.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; - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionActionMode.java deleted file mode 100644 index 422b898..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.mdn; - -/** - * Interface <code>DispositionActionMode</code> marks a type encapsulating - * disposition action mode information as defined by RFC 2298. - */ -public interface DispositionActionMode -{ - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionModifier.java deleted file mode 100644 index 2a8b2a3..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.mdn; - -/** - * Interface <code>DispositionModifier</code> marks a type encapsulating - * disposition modifier information as defined by RFC 2298. - */ -public interface DispositionModifier -{ - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionSendingMode.java deleted file mode 100644 index 3b4055e..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.mdn; - -/** - * Interface <code>DispositionSendingMode</code> marks a type encapsulating - * disposition sending mode information as defined by RFC 2298. - */ -public interface DispositionSendingMode -{ - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/DispositionType.java deleted file mode 100644 index 004d8d1..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.mdn; - -/** - * Interface <code>DispositionType</code> marks a type encapsulating - * disposition type information as defined by RFC 2298. - */ -public interface DispositionType -{ - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/MDNFactory.java deleted file mode 100644 index 0711909..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.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; - } - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/976a3037/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/mdn/ModifierError.java deleted file mode 100644 index ae3c8d3..0000000 --- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/jsieve/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.james.transport.mailets.jsieve.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"; - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org