Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > net/imap idle

Thread Tools

net/imap idle

Payton Swick
Posts: n/a
Perhaps there's another way to do this without polling, but I added the
IMAP IDLE (and associated DONE) command to Shugo Maeda's excellent
net/imap API.

For those unaware, RFC 2177 adds the IDLE command to the IMAP
specification which allows the server to notify clients when a mailbox
has changed state (particularly when new mail has arrived).

When issued, an IDLE command requires a DONE to complete it, which
should be issued at least every 29 minutes, to prevent a timeout.

Anyway, here's the (tiny) piece of code I wrote to implement this; I
hope it's useful. Feel free to tell me what I did wrong.

class Net::IMAP
def idle
cmd = "IDLE"
synchronize do
tag = generate_tag
put_string(tag + " " + cmd)
def done
cmd = "DONE"
synchronize do


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
804 Packet loss during dialer idle timeout process? Loren Amelang Cisco 3 02-07-2005 10:59 PM
Do routers normally drop connections after idle periods? Bartt Wireless Networking 6 12-12-2004 03:35 AM
PIX Idle connection timeout Rob Cisco 1 11-17-2004 11:20 PM
dialer idle-timout doesn't get reset Dennis Ortsen Cisco 4 08-03-2004 02:42 PM
Session-Timeouts and Idle-Timeouts on AS5300 and AS5800 Matt Cisco 1 02-17-2004 06:59 PM