http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/VacationAction.java ---------------------------------------------------------------------- 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; - } -}
http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/VacationReply.java ---------------------------------------------------------------------- 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; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeAutomatic.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ActionModeManual.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/Disposition.java ---------------------------------------------------------------------- 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; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionActionMode.java ---------------------------------------------------------------------- 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 -{ - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionModifier.java ---------------------------------------------------------------------- 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 -{ - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionSendingMode.java ---------------------------------------------------------------------- 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 -{ - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/DispositionType.java ---------------------------------------------------------------------- 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 -{ - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/MDNFactory.java ---------------------------------------------------------------------- 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; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierError.java ---------------------------------------------------------------------- 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"; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierExpired.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierFailed.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierMailboxTerminated.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierSuperseded.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/ModifierWarning.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeAutomatic.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/SendingModeManual.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDeleted.java ---------------------------------------------------------------------- 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"; - } - -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDenied.java ---------------------------------------------------------------------- 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"; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDispatched.java ---------------------------------------------------------------------- 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"; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeDisplayed.java ---------------------------------------------------------------------- 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"; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeFailed.java ---------------------------------------------------------------------- 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"; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/TypeProcessed.java ---------------------------------------------------------------------- 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"; - } -} http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/mdn/package.html ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/java/org/apache/jsieve/mailet/package.html ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/main/resources/sieveConfig.xml ---------------------------------------------------------------------- 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> http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/reporting-site/site.xml ---------------------------------------------------------------------- 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> http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/site/resources/images/asf-logo-reduced.gif ---------------------------------------------------------------------- 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 Binary files a/mailet/src/site/resources/images/asf-logo-reduced.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/site/resources/images/james-jsieve-logo.gif ---------------------------------------------------------------------- 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 Binary files a/mailet/src/site/resources/images/james-jsieve-logo.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/site/site.xml ---------------------------------------------------------------------- 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> http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/mailet/src/site/xdoc/index.xml ---------------------------------------------------------------------- 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-...@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> http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/pom.xml ---------------------------------------------------------------------- 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> http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/src/site/site.xml ---------------------------------------------------------------------- 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" /> http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/af85c909/src/site/xdoc/index.xml ---------------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org