james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1178069 - in /james/server/trunk: lmtpserver/src/main/java/org/apache/james/lmtpserver/ lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/ smtpserver/src/main/java/org/apache/james/smtpserver/
Date Sat, 01 Oct 2011 18:54:42 GMT
Author: norman
Date: Sat Oct  1 18:54:42 2011
New Revision: 1178069

URL: http://svn.apache.org/viewvc?rev=1178069&view=rev
Log:
MailEnvelope.getOutputStream() and MailEnvelope.getInputStream() should throw IOException.
See PROTOCOLS-39

Modified:
    james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java
    james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
    james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java

Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java?rev=1178069&r1=1178068&r2=1178069&view=diff
==============================================================================
--- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java
(original)
+++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/DataLineLMTPHandler.java
Sat Oct  1 18:54:42 2011
@@ -99,7 +99,7 @@ public class DataLineLMTPHandler extends
         }
         
         @Override
-        public OutputStream getMessageOutputStream() throws Exception{
+        public OutputStream getMessageOutputStream() throws IOException{
             throw new IOException("Read-only envelope");
         }
         

Modified: james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java?rev=1178069&r1=1178068&r2=1178069&view=diff
==============================================================================
--- james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
(original)
+++ james/server/trunk/lmtpserver/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
Sat Oct  1 18:54:42 2011
@@ -19,10 +19,10 @@
 
 package org.apache.james.lmtpserver.hook;
 
+import java.io.IOException;
 import java.util.Date;
 
 import javax.annotation.Resource;
-import javax.mail.MessagingException;
 
 import org.apache.james.mailbox.MailboxException;
 import org.apache.james.mailbox.MailboxManager;
@@ -85,7 +85,7 @@ public class MailboxDeliverToRecipientHa
             mailboxManager.endProcessingRequest(mailboxSession);
             result = new HookResult(HookReturnCode.OK, SMTPRetCode.MAIL_OK, DSNStatus.getStatus(DSNStatus.SUCCESS,
DSNStatus.CONTENT_OTHER) + " Message received");
 
-        } catch (MessagingException e) {
+        } catch (IOException e) {
             session.getLogger().info("Unexpected error handling DATA stream", e);
             result = new HookResult(HookReturnCode.DENYSOFT, " Temporary error deliver message
to " + recipient);
         } catch (MailboxException e) {
@@ -94,9 +94,6 @@ public class MailboxDeliverToRecipientHa
         } catch (UsersRepositoryException e) {
             session.getLogger().info("Unexpected error handling DATA stream", e);
             result = new HookResult(HookReturnCode.DENYSOFT, " Temporary error deliver message
to " + recipient);
-        } catch (Exception e) {
-            session.getLogger().info("Unexpected error handling DATA stream", e);
-            result = new HookResult(HookReturnCode.DENYSOFT, " Temporary error deliver message
to " + recipient);
         }
         return result;
     }

Modified: james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java?rev=1178069&r1=1178068&r2=1178069&view=diff
==============================================================================
--- james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
(original)
+++ james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java
Sat Oct  1 18:54:42 2011
@@ -247,8 +247,12 @@ public class DataLineJamesMessageHookHan
         /**
          * @see org.apache.james.protocols.smtp.MailEnvelope#getMessageInputStream()
          */
-        public InputStream getMessageInputStream() throws Exception {
-            return new MimeMessageInputStream(mail.getMessage());
+        public InputStream getMessageInputStream() throws IOException {
+            try {
+                return new MimeMessageInputStream(mail.getMessage());
+            } catch (MessagingException e) {
+                throw new IOException("Unable to get inputstream for message", e);
+            }
         }
 
         /*
@@ -257,7 +261,7 @@ public class DataLineJamesMessageHookHan
          * @see
          * org.apache.james.protocols.smtp.MailEnvelope#getMessageOutputStream()
          */
-        public OutputStream getMessageOutputStream() throws Exception {
+        public OutputStream getMessageOutputStream() throws IOException {
             return out;
         }
 



---------------------------------------------------------------------
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