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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cce84e603505d4bdcb54d4935e5378acd69e3c0426dad9cbf3d3195801260862
4
- data.tar.gz: f9a75e4fe6651894c49c3784f8a068ad015b3d54c1621bb33cbeb3887e03c1c4
3
+ metadata.gz: 248418f6ce3fddc3c6a4f1ac9f6c40e013cb2a534b93a21b21e5a61cff71b0e0
4
+ data.tar.gz: 38580fb0121551ae67498285117a6530bc3dc8687589f3c09abd868148619cc1
5
5
  SHA512:
6
- metadata.gz: e7d9ab1a7b2c4b8a16ffe2c0fd97f5b85885ad607160985ea77db290f1aa095db72ea64d81ff59d68e9271a58adc6fe7edced957aa6eba5ad0514017ceb3773f
7
- data.tar.gz: 8fa950ea432d4ec17a5f32b3e0ac253dd16a7bae2d8ab34bcbb2b0c5fcbc7e6b7c1014eec4f0248bd5f0d32bf023a71dfacfd23a8d410c4ff4e94811bf489338
6
+ metadata.gz: d6f690e989e79e1e79442554914bd28f4895b82e8707e1e76649f816a06ed4c2b9d2fffbd44f5fd6d62930a27886b1ba985b0e6dea31bb5afa59246a562b8a81
7
+ data.tar.gz: 24c65ffa1ea50fc225a21d4f9c15d880c55434a7b5c4541c0bb4f98dc0330dad01b67a5e21f2090f3a1b19129f2d35808bc2f7e9fb578feda9564c8a5d08396a
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
- # Actionmailbox::IMAP
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'
@@ -12,7 +12,7 @@ module ActionMailbox
12
12
  adapter.login(username: username, password: password)
13
13
  end
14
14
 
15
- def select_mailbox(mailbox)
15
+ def mailbox(mailbox)
16
16
  adapter.select_mailbox(mailbox)
17
17
  Mailbox.new(adapter: adapter, mailbox: mailbox)
18
18
  end
@@ -26,11 +26,6 @@ module ActionMailbox
26
26
  end
27
27
 
28
28
  def delete_message(id)
29
- move_message_to(id, "TRASH")
30
- end
31
-
32
- def move_message_to(id, mailbox)
33
- imap.copy(id, mailbox)
34
29
  imap.store(id, "+FLAGS", [:Deleted])
35
30
  end
36
31
 
@@ -8,7 +8,7 @@ module ActionMailbox
8
8
  @mailbox = mailbox
9
9
  end
10
10
 
11
- def not_deleted
11
+ def messages
12
12
  result = adapter.messages_not_deleted
13
13
  Messages.new(adapter: adapter, message_ids: result)
14
14
  end
@@ -16,10 +16,6 @@ module ActionMailbox
16
16
  adapter.delete_message(id)
17
17
  end
18
18
 
19
- def move_to(mailbox)
20
- adapter.move_message_to(id, mailbox)
21
- end
22
-
23
19
  private
24
20
 
25
21
  attr_reader :adapter, :id
@@ -1,5 +1,5 @@
1
1
  module Actionmailbox
2
2
  module Imap
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -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.select_mailbox(config[:ingress_mailbox])
27
+ mailbox = imap.mailbox(config[:ingress_mailbox])
28
28
 
29
- mailbox.not_deleted.take(config[:take]).each do |message|
30
- ActionMailbox::Relayer.new(url: url, password: password).relay(message.rfc822).tap do |result|
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.0
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-20 00:00:00.000000000 Z
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.1
109
+ rubygems_version: 3.0.4
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Relay IMAP messages to ActionMailbox