Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rimian/action_mailbox_debug
Debugging Action Mailbox
https://github.com/rimian/action_mailbox_debug
actionmailbox ruby ruby-on-rails
Last synced: about 1 month ago
JSON representation
Debugging Action Mailbox
- Host: GitHub
- URL: https://github.com/rimian/action_mailbox_debug
- Owner: rimian
- License: mit
- Created: 2020-12-29T02:27:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T00:33:52.000Z (about 4 years ago)
- Last Synced: 2024-05-02T00:08:19.484Z (8 months ago)
- Topics: actionmailbox, ruby, ruby-on-rails
- Language: Ruby
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Action Mailbox Debug
This is a helper to debug Action Mailbox. It's not suitable for running on production servers.
If you have problems with action mailbox and you need to debug it, download your eml file and run it through this gem.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'action_mailbox_debug'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install action_mailbox_debug
## Usage
```ruby
include ActionMailboxDebug::InboundEmail
create_inbound_email_from_file! 'tmp/test.eml'
```This will return an `ActionMailbox::InboundEmail` object or fail if it already exists.
You may wish to do something to the file beforehand
```ruby
include ActionMailboxDebug::InboundEmail
create_inbound_email_from_file! 'tmp/test.eml' do |file|
file.sub('__subject__', 'testing')
end
```Then, you can route the inbound email and fix any errors you might have:
```ruby
inbound_mail.route
```
Or:
```ruby
ActionMailbox::RoutingJob.perform_now inbound_mail
```## Known issues
The [helper](https://edgeapi.rubyonrails.org/classes/ActionMailbox/InboundEmail/MessageId.html#method-i-create_and_extract_message_id-21) fails silently and returns `nil` if a message already exists with the same id. Bummer!