Class | Vmail::ImapClient
In: | lib/vmail/imap_client.rb
Parent: | Object

### Methods

add_more_message_line append_to_file backup_sent_message clear_cached_message close copy_to create_if_necessary daemon decrement_max_seqno deliver divider extract_row_data fetch_and_cache fetch_envelopes fetch_row_text flag format_flags format_headers format_parts_info format_sent_message forward_template get_highest_message_id get_mailbox_status handle_error list_mailboxes log mailbox_aliases mailboxes message_cache more_messages move_to new new_mail_from_input new_message_template number_to_human_size open open_html_part prefetch_adjacent prime_connection reconnect_if_necessary reload_mailbox reply_template revive_connection save_attachments search select_mailbox show_message signature smtp_settings spawn_thread_if_tty start update window_width= with_open

### Included Modules

Vmail::AddressQuoter

### Constants

DIVIDER_WIDTH | = | 46
UNITS | = | [:b, :kb, :mb, :gb].freeze
FLAGMAP | = | {:Flagged => '*'}
SENT_MESSAGES_FILE | = | "sent-messages.txt"

### Attributes

max_seqno | [RW] |

### Public Class methods

daemon(config)
new(config)
start(config)

### Public Instance methods

add_more_message_line(res, start_seqno)
append_to_file(uid_set, file)
backup_sent_message(message)
clear_cached_message()
close()
copy_to(uid_set, mailbox)
create_if_necessary(mailbox)
decrement_max_seqno(num)
deliver(text)
divider(str)
extract_row_data(fetch_data)

TODO extract this to another class or module and write unit tests

fetch_and_cache(uid)
fetch_envelopes(id_set, are_uids, is_update)
fetch_row_text(id_set, are_uids=false, is_update=false)

id_set may be a range, array, or string

flag(uid_set, action, flg)

id_set is a string comming from the vim client action is -FLAGS or +FLAGS

format_flags(flags)

flags is an array like [:Flagged, :Seen]

format_headers(hash)
format_parts_info(parts)
format_sent_message(mail)
forward_template()
get_highest_message_id()
get_mailbox_status()

not used for anything

handle_error(error)
list_mailboxes()
log(string)
mailbox_aliases()

do this just once

mailboxes()

called internally, not by vim client

message_cache()

holds mail objects keyed by [mailbox, uid]

more_messages(message_id, limit=100)

gets 100 messages prior to id

move_to(uid_set, mailbox)
new_mail_from_input(text)
new_message_template(subject = nil, append_signature = true)
number_to_human_size(number)

borrowed from ActionView/Helpers

open()
open_html_part()
prefetch_adjacent(index)

deprecated

prime_connection()
reconnect_if_necessary(timeout = 60, &block)
reload_mailbox()
reply_template(replyall=false)
revive_connection()
save_attachments(dir)
search(query)
select_mailbox(mailbox, force=false)
show_message(uid, raw=false)
signature()
smtp_settings()
spawn_thread_if_tty(&block)
update()
window_width=(width)
with_open() {|self| ...}

expects a block, closes on finish

[Validate]