Method: ICFS::Email::Imap#initialize

Defined in:
lib/icfs/email/imap.rb

#initialize(core, log, opts = {}) ⇒ Imap

New instance

Parameters:

  • core (Email::Core)

    The core email processor

  • log (Logger)

    The log

  • opts (Hash) (defaults to: {})

    configuration options

Options Hash (opts):

  • :address (String)

    The server address

  • :port (Integer)

    The server port

  • :enable_ssl (Boolean)

    Use SSL or not

  • :username (String)

    The login username

  • :password (String)

    The login password

  • :mailbox (String)

    The mailbox to read

  • :keys (Array, String)

    keys to pass to Net::IMAP#uid_search

  • :idle_time (Integer)

    Seconds to wait IDLE before polling

  • :reconnect (Integer)

    Seconds after which we can reconnect



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/icfs/email/imap.rb', line 42

def initialize(core, log, opts={})
  @core = core
  @log = log
  @cfg = {
    :port => 993,
    :enable_ssl => true,
    :keys => 'ALL',
    :idle_time => 60*5,
    :reconnect => 60*15,
  }.merge!(opts)
end