<commit_before># mail_room #

mail_room is a configuration based process that will idle on IMAP connections and POST to a delivery URL whenever a new message is received on the configured mailbox and folder.

[![Build Status](https://travis-ci.org/tpitale/mail_room.png?branch=master)](https://travis-ci.org/tpitale/mail_room)

## Installation ##

Add this line to your application's Gemfile:

    gem 'mail_room'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install mail_room

## Usage ##

    mail_room -c /path/to/config.yml

## Configuration ##

    ---
    :mailboxes:
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_url: "http://localhost:3000/inbox"
        :delivery_token: "<PASSWORD>"
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_method: postback
        :delivery_url: "http://localhost:3000/inbox"
        :delivery_token: "<PASSWORD>"
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_method: logger
        :log_path: "/var/log/user3-email.log"
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_method: letter_opener
        :location: "/tmp/user4-email"

## delivery_method ##

### postback ###

The default delivery method, requires `delivery_url` and `delivery_token` in configuration.

As the postback is essentially using your app as if it were an API endpoint, you may need to disable
forgery protection as you would with a JSON API. In our case, the postback is plaintext, but the
protection will still need to be disabled.

### logger ###

Configured with `:delivery_method: logger`.

If `:log_path:` is not provided, defaults to `STDOUT`

### noop ###

Configured with `:delivery_method: noop`.

Does nothing, like it says.

### letter_opener ###

Configured with `:delivery_method: letter_opener`.
<commit_msg>add gem requirements to the README<commit_after># mail_room #

mail_room is a configuration based process that will idle on IMAP connections and POST to a delivery URL whenever a new message is received on the configured mailbox and folder.

[![Build Status](https://travis-ci.org/tpitale/mail_room.png?branch=master)](https://travis-ci.org/tpitale/mail_room)

## Installation ##

Add this line to your application's Gemfile:

    gem 'mail_room'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install mail_room

## Usage ##

    mail_room -c /path/to/config.yml

## Configuration ##

    ---
    :mailboxes:
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_url: "http://localhost:3000/inbox"
        :delivery_token: "<PASSWORD>"
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_method: postback
        :delivery_url: "http://localhost:3000/inbox"
        :delivery_token: "<PASSWORD>"
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_method: logger
        :log_path: "/var/log/user3-email.log"
      -
        :email: "<EMAIL>"
        :password: "password"
        :name: "inbox"
        :delivery_method: letter_opener
        :location: "/tmp/user4-email"

## delivery_method ##

### postback ###

Requires `faraday` gem be installed.

The default delivery method, requires `delivery_url` and `delivery_token` in 
configuration.

As the postback is essentially using your app as if it were an API endpoint, 
you may need to disable forgery protection as you would with a JSON API. In 
our case, the postback is plaintext, but the protection will still need to be 
disabled.

### logger ###

Configured with `:delivery_method: logger`.

If `:log_path:` is not provided, defaults to `STDOUT`

### noop ###

Configured with `:delivery_method: noop`.

Does nothing, like it says.

### letter_opener ###

Requires `letter_opener` gem be installed.

Configured with `:delivery_method: letter_opener`.

{'fraction_non_alphanumeric': 0.11756061719324026, 'fraction_numerical': 0.004898359049718345, 'mean_word_length': 2.9805068226120857, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5658718', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1272, 'n_words': 393}