Support for IMAP IDLE in net/imap

Discussion in 'Ruby' started by Abhishiv Saxena, Jul 3, 2009.

  1. Ok, I have been stuck on it for hours. I thought net/imap.rb with ruby
    1.9 supported the idle command, but not yet.

    Can anyone help me in implementing that? From here, I though this would
    work:

    class Net::IMAP
    def idle

    cmd = "IDLE"
    synchronize do
    tag = generate_tag

    put_string(tag + " " + cmd)

    put_string(CRLF)
    end
    end


    def done
    cmd = "DONE"

    synchronize do
    put_string(cmd)
    put_string(CRLF)

    end
    end
    end

    But, when i issue imap.idle, it return true, but i have to press return
    twice to get the server response. And there's no notification for new
    messages.

    ?> imap.idle
    C: RUBY0005 IDLE
    => true

    >>

    ?>
    ?> S: + idling
    --
    Posted via http://www.ruby-forum.com/.
     
    Abhishiv Saxena, Jul 3, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Youngblood

    TLS support in Net::IMAP?

    Carl Youngblood, Jun 14, 2004, in forum: Ruby
    Replies:
    0
    Views:
    205
    Carl Youngblood
    Jun 14, 2004
  2. Payton Swick

    net/imap idle

    Payton Swick, Jan 5, 2006, in forum: Ruby
    Replies:
    0
    Views:
    299
    Payton Swick
    Jan 5, 2006
  3. Sean Hussey
    Replies:
    5
    Views:
    202
    Dick Davies
    Mar 10, 2006
  4. Henrik Ormåsen

    Curier-IMAP and imap.create()

    Henrik Ormåsen, Aug 19, 2006, in forum: Ruby
    Replies:
    0
    Views:
    347
    Henrik Ormåsen
    Aug 19, 2006
  5. Jon Fi
    Replies:
    4
    Views:
    977
    Kashia Buch
    Oct 21, 2006
  6. jasonnaylor
    Replies:
    1
    Views:
    411
    jasonnaylor
    Apr 16, 2008
  7. Adam Akhtar
    Replies:
    1
    Views:
    339
    Eric Hodel
    Dec 15, 2008
  8. Abhishiv Saxena

    Support for IMAP IDLE in net/imap

    Abhishiv Saxena, Jul 3, 2009, in forum: Ruby
    Replies:
    4
    Views:
    366
    Eric Hodel
    Jul 4, 2009
Loading...