Loading...

server-dev@james.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

svn commit: r767519 - /james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java mwiederkehr Mon Apr 27 13:07:42 2009

Author: mwiederkehr
Date: Wed Apr 22 13:37:53 2009
New Revision: 767519

URL: http://svn.apache.org/viewvc?rev=767519&view=rev
Log:
James-899: Consider message delivered even if transport.close() fails.

Modified:
    
james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java

Modified: 
james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: 
http://svn.apache.org/viewvc/james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java?rev=767519&r1=767518&r2=767519&view=diff
==============================================================================
--- 
james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
 (original)
+++ 
james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
 Wed Apr 22 13:37:53 2009
@@ -562,7 +562,21 @@
                         transport.sendMessage(message, addr);
                     } finally {
                         if (transport != null) {
-                            transport.close();
+                            try
+                            {
+                              // James-899: transport.close() sends QUIT to 
the server; if that fails
+                              // (e.g. because the server has already closed 
the connection) the message
+                              // should be considered to be delivered because 
the error happened outside
+                              // of the mail transaction (MAIL, RCPT, DATA). 
+                              transport.close();
+                            }
+                            catch (MessagingException e)
+                            {
+                              log("Warning: could not close the SMTP transport 
after sending mail (" + mail.getName()
+                                  + ") to " + outgoingMailServer.getHostName() 
+ " at " + outgoingMailServer.getHost()
+                                  + " for " + mail.getRecipients() + "; 
probably the server has already closed the "
+                                  + "connection. Message is considered to be 
delivered. Exception: " + e.getMessage());
+                            }
                             transport = null;
                         }
                     }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]