Revision 3f78d2ea
Added by Marc Dequènes over 14 years ago
- ID 3f78d2ea0890eba1102c23a37c5dbd029f429c30
lib/cyborghood/imap.rb | ||
---|---|---|
end
|
||
end
|
||
|
||
def capabilities
|
||
return @imap_capab if @imap_capab
|
||
@imap_capab = @imap.capability
|
||
end
|
||
|
||
def connect
|
||
return true if @imap
|
||
|
||
... | ... | |
logger.warn "Could not connect to the IMAP server"
|
||
return false
|
||
end
|
||
logger.debug "Connected (IMAP Capabilities: " + @imap.capability.join(", ") + ")"
|
||
logger.debug "Connected (IMAP Capabilities: " + self.capabilities.join(", ") + ")"
|
||
#p @imap.getquotaroot("INBOX")
|
||
|
||
@stop_mail_check = false
|
||
... | ... | |
return if not (@config.debug.nil? or @config.debug.flags.nil?) and @config.debug.flags.include?(:debug_nomaildeletion)
|
||
end while waiting_mails?
|
||
|
||
if @imap.capability.include?("IDLE")
|
||
if self.capabilities.include?("IDLE")
|
||
logger.debug "Waiting for new mails in idle mode"
|
||
@imap.idle #do |resp|
|
||
sleep(1) until @stop_mail_check or waiting_mails?
|
||
... | ... | |
logger.debug "Disconnected from IMAP server"
|
||
@imap = nil
|
||
@is_loggued = false
|
||
@imap_capab = nil
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
[evol] don't refetch IMAP capabilities during the same connection