[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

still having problems with exceptions in IMAP module

Russell Fulton

1/25/2006 2:12:00 AM

I have this method defined in a program I use for checking access to
IMAP accounts.

def tryIMAP (host, usessl, user, pass)
retryc = false
proto = usessl ? "IMAPS" : "IMAP"
begin
imap = Net::IMAP.new(host, usessl ? 993 : 143, usessl)
rescue Net::IMAP::ByeResponseError => e
imap.disconnect if imap
STDERR.print "#{host} #{proto} #{e.to_s}\n";
retryc = true
rescue => e
imap.disconnect if imap
STDERR.print "#{host} #{proto} #{e.to_s}\n";
return 'aborted'
end while retryc
begin
imap.login( user, pass)
imap.logout
imap.disconnect
'success'
rescue Net::IMAP::NoResponseError
'failure'
end
end

As you can see I explicitly have a rescue clause for
Net::IMAP::ByeResponseError but I still get the error raised at runtime
:(

(Net::IMAP::ByeResponseError)948:in `receive_responses': * BYE
Autologout; idle for too long
from /usr/lib/ruby/1.8/net/imap.rb:932:in `synchronize'
from /usr/lib/ruby/1.8/net/imap.rb:932:in `receive_responses'
from /usr/lib/ruby/1.8/net/imap.rb:917:in `initialize'
from /usr/lib/ruby/1.8/net/imap.rb:916:in `start'
from /usr/lib/ruby/1.8/net/imap.rb:916:in `initialize'
from test.rb:11:in `new'
from test.rb:11:in `tryIMAP'
from test.rb:149
from test.rb:105:in `each'
from test.rb:105
from test.rb:94:in `each'
from test.rb:94
from test.rb:93:in `open'
from test.rb:93

I am testing several thousand accounts and this error happens at random
places in the list on different runs.

Can anyone suggest where I go from here. I suspect this is a bug
somewhere in imap.rb but I can't reproduce this reliably. Sigh...

Russell

--
Posted via http://www.ruby-....


2 Answers

The Peeler

6/28/2013 4:32:00 PM

0

On Fri, 28 Jun 2013 06:37:47 -0700, TThe Rectum, the resident psychopath of
sci and scj, FAKING his time zone again and IMPERSONATING his master, The
Peeler, wrote:

>> >> >> Are what? I AM right! You know it, I know it, everyone here knows it! <BG>
>> >> >
>> >> > They, DO The Grik anus! LOL3
>> >>
>> >> Of course, they do!
>> >
>> > Of, COURSE The Grik anus!
>>
>> Right, of COURSE everyone here knows that I'm right, poor sod!
>
> They, DO The Grik anus! <BBB>

They do, right, The Rectum! <BG>

--
bozo about "The Rectum":
"you don't make any sense gordon "revd" Radavich you poor colostomy bag
of a cripple, you're just an ex-pat pail of serb garbage spewing,
spamming, and shitting all over yourself you poor witless copy-pasting
kelpless invalid"
MID: <1b0e165f-d518-4ea5-8b38-9d7349db5b85@q8g2000pbn.googlegroups.com>

The Peeler

6/29/2013 3:42:00 AM

0

On Fri, 28 Jun 2013 18:32:25 +0200, The Peeler
<finishingoff@themoronicRevd.invalid> wrote:


>>> Right, of COURSE everyone here knows that I'm an anus and a, poor sod!
>>
>> They, DO The Grik anus! <BBB>
>
>They do, right, The Rectum! <BG>

Of, COURSE The Grik anus! <GB>