croaky/recipient_interceptor — pull request #8 by thomasklemm (2014-04-30 11:56:55+00:00)
Title: Add email and domain whitelist options

@croaky Thanks for this great gem.

This PR adds two options:

1) Optionally white-list emails:

```ruby
Mail.register_interceptor RecipientInterceptor.new(
ENV['EMAIL_RECIPIENTS'],
email_whitelist: ['whitelisted@example.com']
)
````

2) Optionally white-list domains:

```ruby
Mail.register_interceptor RecipientInterceptor.new(
ENV['EMAIL_RECIPIENTS'],
domain_whitelist: ['example.com']
)
```

If one or more of the original recipients match the email white-list or domain white-list, the email's to field will not be overridden. However, non-white-listed emails will be removed from the email's to field.