Your message dated Tue, 11 Apr 2006 19:00:24 +0900
with message-id <[EMAIL PROTECTED]>
and subject line Bug#361780: Sending mail after connection timeout should raise
an exception
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: libruby1.8
Version: 1.8.4-1
Coin,
I discovered a bug in log4r, not sending a mail when flushing (see
#361349), because the SMTP connection remained opened since the opening
of the log, which could be a very long time. I made a fix for log4r, but
another fix is needed for net::smtp because no exception was raised when
trying to send a mail after the timeout (was quite bad for debugging).
Regards.
--
Marc Dequènes (Duck)
pgpmnd18jSbrw.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Hello,
Marc Dequènes (Duck) wrote:
> I discovered a bug in log4r, not sending a mail when flushing (see
> #361349), because the SMTP connection remained opened since the opening
> of the log, which could be a very long time. I made a fix for log4r, but
> another fix is needed for net::smtp because no exception was raised when
> trying to send a mail after the timeout (was quite bad for debugging).
I think that Net::SMTP does not have a such bug.
In the situation Net::SMTP raises Net::SMTPServerBusy.
I tested as follows:
$ ruby -r net/smtp -e '
smtp = Net::SMTP.start("smtp.example.com")
sleep 60*6
smtp.sendmail("... message header & body ...", "[EMAIL PROTECTED]", ["[EMAIL
PROTECTED]"])
puts "OK"'
/usr/lib/ruby/1.8/net/smtp.rb:680:in `check_response': 421 smtp.example.com
Error: timeout exceeded (Net::SMTPServerBusy)
from /usr/lib/ruby/1.8/net/smtp.rb:653:in `getok'
from /usr/lib/ruby/1.8/net/smtp.rb:631:in `mailfrom'
from /usr/lib/ruby/1.8/net/smtp.rb:544:in `send0'
from /usr/lib/ruby/1.8/net/smtp.rb:472:in `sendmail'
from -e:4
But Log4r::EmailOutputter#send_mail drops it at line 105-110:
begin @smtp.sendmail(rfc822msg, @from, @to)
rescue Exception => e
Logger.log_internal(-2) {
"EmailOutputter '[EMAIL PROTECTED]' couldn't send email!"
}
Logger.log_internal {e}
self.level = OFF
ensure @buff.clear
end
"rescue Exception" captures all exceptions which are raised by "@smtp.sendmail"
and the block does not raise any exceptions.
If it is not a specification of Log4r::EmailOutputter,
"raise e" is needed in the rescue-block.
Thank you.
--
akira yamada
--- End Message ---