Module MailRoom
In: lib/mail_room.rb
lib/mail_room/coordinator.rb
lib/mail_room/mailbox.rb
lib/mail_room/arbitration.rb
lib/mail_room/delivery/noop.rb
lib/mail_room/delivery/sidekiq.rb
lib/mail_room/delivery/letter_opener.rb
lib/mail_room/delivery/que.rb
lib/mail_room/delivery/postback.rb
lib/mail_room/delivery/logger.rb
lib/mail_room/cli.rb
lib/mail_room/delivery.rb
lib/mail_room/version.rb
lib/mail_room/arbitration/noop.rb
lib/mail_room/arbitration/redis.rb
lib/mail_room/configuration.rb
lib/mail_room/backports/imap.rb
lib/mail_room/mailbox_watcher.rb
lib/mail_room/connection.rb

Methods

arbitration_klass   arbitrator   deliver   deliver   deliver   deliver   deliver   deliver   deliver   deliver?   deliver?   deliver?   delivery   delivery_klass   new   new   new   new   new   new   new   new   new   ssl_options   validate!  

Classes and Modules

Module MailRoom::Arbitration
Module MailRoom::Delivery
Class MailRoom::CLI
Class MailRoom::Configuration
Class MailRoom::Connection
Class MailRoom::Coordinator
Class MailRoom::IMAP
Class MailRoom::MailboxWatcher

Constants

MAILBOX_FIELDS = [ :email, :password, :host, :port, :ssl, :start_tls, :idle_timeout, :search_command, :name, :delete_after_delivery, :delivery_method, # :noop, :logger, :postback, :letter_opener :log_path, # for logger :delivery_url, # for postback :delivery_token, # for postback :location, # for letter_opener :delivery_options, :arbitration_method, :arbitration_options   Mailbox Configuration fields
IdleTimeoutTooLarge = Class.new(RuntimeError)
Mailbox = Struct.new(*MAILBOX_FIELDS) do # Keep it to 29 minutes or less # The IMAP serve will close the connection after 30 minutes of inactivity # (which sending IDLE and then nothing technically is), so we re-idle every # 29 minutes, as suggested by the spec: https://tools.ietf.org/html/rfc2177 IMAP_IDLE_TIMEOUT = 29 * 60   Holds configuration for each of the email accounts we wish to monitor
  and deliver email to when new emails arrive over imap
DEFAULTS = { :search_command => 'UNSEEN', :delivery_method => 'postback', :host => 'imap.gmail.com', :port => 993, :ssl => true, :start_tls => false, :idle_timeout => IMAP_IDLE_TIMEOUT, :delete_after_delivery => false, :delivery_options => {}, :arbitration_method => 'noop', :arbitration_options => {}   Default attributes for the mailbox configuration
VERSION = "0.9.1"   Current version of MailRoom gem
EXPIRATION = 600   Expire after 10 minutes so Redis doesn‘t get filled up with outdated data.

Attributes

options  [RW] 
options  [R] 
options  [RW] 

Public Class methods

Build a new delivery, hold the delivery options @param [MailRoom::Delivery::Postback::Options]

Build a new delivery, hold the mailbox configuration @param [MailRoom::Delivery::Que::Options]

build a new delivery, do nothing

Build a new delivery, hold the mailbox configuration @param [MailRoom::Delivery::Sidekiq::Options]

Build a new delivery, hold the delivery options

  open a file or stdout for IO depending on the options

@param [MailRoom::Delivery::Logger::Options]

Build a new delivery, hold the delivery options @param [MailRoom::Delivery::LetterOpener::Options]

Store the configuration and require the appropriate delivery method @param attributes [Hash] configuration options

Public Instance methods

deliver the message by pushing it onto the configured Sidekiq queue @param message [String] the email message as a string, RFC822 format

Write the message to our logger @param message [String] the email message as a string, RFC822 format

Trigger `LetterOpener` to deliver our message @param message [String] the email message as a string, RFC822 format

deliver the message by pushing it onto the configured Sidekiq queue @param message [String] the email message as a string, RFC822 format

deliver the imap email message @param message [Net::IMAP::FetchData]

deliver the message using Faraday to the configured delivery_options url @param message [String] the email message as a string, RFC822 format

accept the delivery, do nothing

true, false, or ssl options hash

[Validate]