Class | Larch::IMAP |
In: |
lib/larch/imap/mailbox.rb
lib/larch/errors.rb lib/larch/imap.rb |
Parent: | Object |
Manages a connection to an IMAP server and all the glorious fun that entails.
This class borrows heavily from Sup, the source code of which should be required reading if you‘re doing anything with IMAP in Ruby: sup.rubyforge.org
REGEX_URI | = | URI.regexp(['imap', 'imaps']) | URI format validation regex. | |
Message | = | Struct.new(:guid, :envelope, :rfc822, :flags, :internaldate) | Larch::IMAP::Message represents a transferable IMAP message which can be passed between Larch::IMAP instances. |
conn | [R] | |
db_account | [R] | |
mailboxes | [R] | |
options | [R] | |
quirks | [R] |
Initializes a new Larch::IMAP instance that will connect to the specified IMAP URI.
In addition to the URI, the following options may be specified:
Iterates through all mailboxes in the account, yielding each one as a Larch::IMAP::Mailbox instance to the given block.
Gets a Larch::IMAP::Mailbox instance representing the specified mailbox. If the mailbox doesn‘t exist and the :create_mailbox option is false, or if :create_mailbox is true and mailbox creation fails, a Larch::IMAP::MailboxNotFoundError will be raised.