| 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. |
| options | [RW] | |
| options | [R] | |
| options | [RW] |
Store the configuration and require the appropriate delivery method @param attributes [Hash] configuration options
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 message using Faraday to the configured delivery_options url @param message [String] the email message as a string, RFC822 format