actionmailbox-imap 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/actionmailbox/imap.rb +1 -1
- data/lib/actionmailbox/imap/adapters/net_imap.rb +0 -5
- data/lib/actionmailbox/imap/mailbox.rb +1 -1
- data/lib/actionmailbox/imap/message.rb +0 -4
- data/lib/actionmailbox/imap/version.rb +1 -1
- data/lib/tasks/actionmailbox/ingress.rake +5 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 248418f6ce3fddc3c6a4f1ac9f6c40e013cb2a534b93a21b21e5a61cff71b0e0
|
4
|
+
data.tar.gz: 38580fb0121551ae67498285117a6530bc3dc8687589f3c09abd868148619cc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6f690e989e79e1e79442554914bd28f4895b82e8707e1e76649f816a06ed4c2b9d2fffbd44f5fd6d62930a27886b1ba985b0e6dea31bb5afa59246a562b8a81
|
7
|
+
data.tar.gz: 24c65ffa1ea50fc225a21d4f9c15d880c55434a7b5c4541c0bb4f98dc0330dad01b67a5e21f2090f3a1b19129f2d35808bc2f7e9fb578feda9564c8a5d08396a
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
#
|
2
|
-
[![CircleCI](https://circleci.com/gh/kimmelsg/actionmailbox-imap.svg?style=svg)](https://circleci.com/gh/kimmelsg/actionmailbox-imap)
|
1
|
+
# ActionMailbox::IMAP
|
2
|
+
[![CircleCI](https://circleci.com/gh/kimmelsg/actionmailbox-imap.svg?style=svg)](https://circleci.com/gh/kimmelsg/actionmailbox-imap)
|
3
|
+
[![RubyGems](https://badge.fury.io/rb/actionmailbox-imap.svg)](https://rubygems.org/gems/actionmailbox-imap)
|
4
|
+
[![Standard](https://camo.githubusercontent.com/58fbab8bb63d069c1e4fb3fa37c2899c38ffcd18/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d7374616e646172642d627269676874677265656e2e737667)](https://github.com/testdouble/standard)
|
3
5
|
|
4
6
|
A IMAP relay for ActionMailbox.
|
5
7
|
|
@@ -52,13 +54,12 @@ Prepare your IMAP server and account by ensuring/creating the mailboxes for `ing
|
|
52
54
|
|
53
55
|
Update the `config/imap.yml` that was generated to include server and credentials information, `ingress_mailbox` and an appropriate `take` amount ( the amount of emails to grab in a single run ).
|
54
56
|
|
55
|
-
Run or schedule `rails action_mailbox:ingress:imap URL="http://localhost/rails/action_mailbox/inbound_email" INGRESS_PASSWORD="YourIngressPassword"` to run at a selected interval.
|
57
|
+
Run or schedule `rails action_mailbox:ingress:imap URL="http://localhost/rails/action_mailbox/relay/inbound_email" INGRESS_PASSWORD="YourIngressPassword"` to run at a selected interval.
|
56
58
|
|
57
59
|
The command behaves much like that of the other `action_mailbox:ingress:...` commands in that it relays the message the same way. Although messages should be piped to the other ingress commands and `rails action_mailbox:ingress:imap ...` needs to be scheduled appropriately.
|
58
60
|
|
59
61
|
## Installation
|
60
62
|
Add this line to your application's Gemfile:
|
61
|
-
( Gem is not published to rubygems.org currently, you can point to this github url though )
|
62
63
|
|
63
64
|
```ruby
|
64
65
|
gem 'actionmailbox-imap'
|
data/lib/actionmailbox/imap.rb
CHANGED
@@ -24,12 +24,13 @@ namespace :action_mailbox do
|
|
24
24
|
|
25
25
|
imap.login(username: config[:username], password: config[:password])
|
26
26
|
|
27
|
-
mailbox = imap.
|
27
|
+
mailbox = imap.mailbox(config[:ingress_mailbox])
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
relayer = ActionMailbox::Relayer.new(url: url, password: password)
|
30
|
+
|
31
|
+
mailbox.messages.take(config[:take]).each do |message|
|
32
|
+
relayer.relay(message.rfc822).tap do |result|
|
31
33
|
message.delete if result.success?
|
32
|
-
message.move_to(config[:retry_mailbox]) unless result.success?
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailbox-imap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan Knowlton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.0.
|
109
|
+
rubygems_version: 3.0.4
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Relay IMAP messages to ActionMailbox
|