Module: Vmail

Extended by:
Vmail
Included in:
Vmail
Defined in:
lib/vmail.rb,
lib/vmail/query.rb,
lib/vmail/sender.rb,
lib/vmail/helpers.rb,
lib/vmail/options.rb,
lib/vmail/version.rb,
lib/vmail/database.rb,
lib/vmail/database.rb,
lib/vmail/defaults.rb,
lib/vmail/searching.rb,
lib/vmail/imap_client.rb,
lib/vmail/inbox_poller.rb,
lib/vmail/send_options.rb,
lib/vmail/address_quoter.rb,
lib/vmail/showing_headers.rb,
lib/vmail/showing_message.rb,
lib/vmail/reply_templating.rb,
lib/vmail/message_formatter.rb,
lib/vmail/contacts_extractor.rb,
lib/vmail/flagging_and_moving.rb

Defined Under Namespace

Modules: AddressQuoter, Defaults, FlaggingAndMoving, Helpers, ReplyTemplating, Searching, Sender, ShowingHeaders, ShowingMessage Classes: ContactsExtractor, ImapClient, InboxPoller, Label, Labeling, Message, MessageFormatter, Options, Query, SendOptions

Constant Summary collapse

BUFFER_FILE =
'vmailbuffer'
DIVIDER_WIDTH =
46
UNITS =
[:b, :k, :M, :G].freeze
INSTRUCTIONS =
<<-EOF
Please visit http://danielchoi.com/software/vmail.html for instructions
on how to configure and run vmail.

EOF
VERSION =
'2.9.7'

Instance Method Summary collapse

Instance Method Details

#startObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/vmail.rb', line 12

def start
  puts "Starting vmail #{ Vmail::VERSION }"
  check_ruby_version

  set_vmail_browser
  check_html_reader
  change_directory_to_vmail_home

  logfile = (vim == 'mvim' || vim == 'gvim') ? STDERR : 'vmail.log'
  config.merge! 'logfile' => logfile

  puts "Starting vmail imap client for #{ config['username'] }"

  set_inbox_poller

  puts "Working directory: #{ Dir.pwd }"

  server = start_imap_daemon
  mailbox, query_string = select_mailbox(server)

  start_vim(mailbox, query_string)

  if vim == 'mvim' || vim == 'gvim'
    DRb.thread.join
  end

  close_connection
end