[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-user
Subject:    RemoteDelivery Thread may hang forever
From:       Stephan Schiessling <s () rapi ! com>
Date:       2001-10-20 14:47:54
[Download RAW message or body]


Sometimes james denies to proceed with sending email to remote
mail servers.

I debugged this problem. It hangs in transport.connect() in 
RemoteDelivery.java, so it hangs inside JavaMail. The reason is,
that the Socket has no timeout set.

Fortunately, JavaMail allows us to set such timeout, and therefore
a fix in james is possible in the following way:

If Session is created, a property "mail.smtp.timeout" should be set.
(If SMTP is used).

In RemoteDelivery.java, run() method,

     public void run() {
         //Checks the pool and delivers a mail message
         Properties props = new Properties();
	String timeout = getInitParameter("timeout");
	log("timeout="+timeout);
	if (timeout == null) timeout = "600000";
	props.put("mail.smtp.timeout", timeout);
         Session session = Session.getInstance(props, null);
         ...


Then RemoteDelivery has a new parameter to set the timeout. Example:

   <mailet match="All" class="RemoteDelivery">
     <outgoing> file://../var/mail/outgoing/ </outgoing>
     <delayTime> 60000 </delayTime>
     <maxRetries> 288 </maxRetries>
     <timeout> 300000 </timeout>
   </mailet>


This could be improved to support more protocols, but for that
it is preferable to improve the API to get parameters.

Bye,

Stephan Schiessling
s@rapi.com


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic