Thanks Rauno! I noticed the hanging from time to time but was never able to reliably recreate or identify the problem. I'll look to have the message loaded completely before calling sendMail, and will also look into why sendMail is synchronized and seeing whether this can be relaxed at all.
Serge Knystautas Loki Technologies - Unstoppable Websites http://www.lokitech.com/ ----- Original Message ----- From: "Rauno Palosaari" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 23, 2001 4:34 AM Subject: James and multiple incoming mail. > Hi guys and dolls. > > There is a problem with multiple incoming SMTP messages to James (and a > workaround). > The problem is that a thread receiving the DATA part from a client will > block other clients DATA or QUITs. > > To reproduce it: > Start 2 telnet sessions to James (telnet 127.0.0.1 25) > Client 1 sends: > >>>> > HELO rauno > MAIL FROM: <[EMAIL PROTECTED]> > RCPT TO: <[EMAIL PROTECTED]> > DATA > Subject: Test > > Some dummy data, do not send <CRLF>.<CRLF> yet > <<<< > Client 2 sends > >>>> > HELO rauno > MAIL FROM: <[EMAIL PROTECTED]> > RCPT TO: <[EMAIL PROTECTED]> > DATA > Subject: Test > > Some dummy data > <CRLF>.<CRLF> > <<<< > > Client 2 doesn't get "250 Message received" until client 1 sends the > final <CRLF>.<CRLF> > > The problem is that sendMail is synchronized in James.java: > public synchronized void sendMail(MailAddress sender, Collection > recipients, InputStream msg) > > The workaround is to read the entire message before sendMail( > > In SMTPHandler.java, private boolean parseCommand(String command) in > DATA, before the call: > mailServer.sendMail(mail); > add: > mail.getSize(); // force the entire message to be read. > > this forces MailImpl to read the entire mail before the call to sendMail( > > I just got the latest CVS sources and SMTPHandler.java, doDATA(..) has a > test on if maxmessagesize is set that will force the message to be read > before sendMail(..) > If you don't limit the size of incoming mail just set this value very high. > > -rauno --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
