james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r712492 - in /james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve: Actions.java Poster.java SieveToMultiMailbox.java
Date Sun, 09 Nov 2008 12:24:54 GMT
Author: rdonkin
Date: Sun Nov  9 04:24:53 2008
New Revision: 712492

URL: http://svn.apache.org/viewvc?rev=712492&view=rev
Log:
Change proposed API to avoid dependency on MailImpl. Maybe a streaming APi would be better
(less copying) but one step at a time...

Modified:
    james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Actions.java
    james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Poster.java
    james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java

Modified: james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Actions.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Actions.java?rev=712492&r1=712491&r2=712492&view=diff
==============================================================================
--- james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Actions.java
(original)
+++ james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Actions.java
Sun Nov  9 04:24:53 2008
@@ -30,7 +30,6 @@
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
 
-import org.apache.james.core.MailImpl;
 import org.apache.james.util.mail.mdn.ActionModeAutomatic;
 import org.apache.james.util.mail.mdn.Disposition;
 import org.apache.james.util.mail.mdn.DispositionModifier;
@@ -109,9 +108,7 @@
             final String url = "mailbox://" + recipient.getUser() + "@localhost/" + 
                 destinationMailbox.replace(HIERARCHY_DELIMITER, '/');
             //TODO: copying this message so many times seems a waste
-            Mail mail = new MailImpl();
-            mail.setMessage(localMessage);
-            poster.post(url, mail);
+            poster.post(url, localMessage);
             delivered = true;
         }
         catch (MessagingException ex)

Modified: james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Poster.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Poster.java?rev=712492&r1=712491&r2=712492&view=diff
==============================================================================
--- james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Poster.java
(original)
+++ james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/Poster.java
Sun Nov  9 04:24:53 2008
@@ -20,8 +20,7 @@
 package org.apache.james.transport.mailets.sieve;
 
 import javax.mail.MessagingException;
-
-import org.apache.mailet.Mail;
+import javax.mail.internet.MimeMessage;
 
 /**
  * Experimental interface.
@@ -36,5 +35,5 @@
      * the value should be mailbox://<user>@localhost/<mailbox-path>
      * @param mail not null
      */
-    public void post(String url, Mail mail) throws MessagingException;
+    public void post(String url, MimeMessage mail) throws MessagingException;
 }

Modified: james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java?rev=712492&r1=712491&r2=712492&view=diff
==============================================================================
--- james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java
(original)
+++ james/server/trunk/spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java
Sun Nov  9 04:24:53 2008
@@ -254,7 +254,7 @@
     
     void storeMessageInbox(String username, Mail mail) throws MessagingException {
         String url = "mailbox://" + username + "@localhost/";
-        poster.post(url, mail);
+        poster.post(url, mail.getMessage());
     }
 
     /**



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


Mime
View raw message