james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwiederk...@apache.org
Subject svn commit: r767519 - /james/server/branches/v2.3/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
Date Wed, 22 Apr 2009 13:37:53 GMT
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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message