A
Abhishiv Saxena
[Note: parts of this message were removed to make it a legal post.]
Ok, I have been suck 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<http://www.ruby-forum.com/topic/50828>,
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
Ok, I have been suck 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<http://www.ruby-forum.com/topic/50828>,
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