clacks 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/clacks/service.rb +6 -4
- data/lib/clacks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODk1Y2ZlZDEzYTUwMTUwNTUyODEwM2ZmM2JiMDY2MmRiOTRiZjQ5OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjhlNDZlMjA1YjIxOGYzMjVlYzBmNjcyYzU1NGE1MmFhOGJmMjk5ZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTgzZTU3MTgzMjUyMWM4NzVhMGE4ZTNhYjA3YTVkYTg0YTg0NjQzOWFkMGM3
|
10
|
+
ZDAwOTA4YjJhNTEzNjlkMWVhMjUxZDE3ZTIyNTQzOTg5ODY1ZTc2NjE1Y2Iy
|
11
|
+
MDZlNjVhMjUzODM4YTQ2N2QwNTc5ZDhmZTk2NmZiNjk4ZjA4NDc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDBjZjQ2ZTM1MGU1MzgzZTZmNGVkN2IyNTJmYzViZTIzZThiOTMzYjc1ZGU4
|
14
|
+
NGZhNzBlMWIxYzcwNzQyZTJhZWU0OGI3MzlkMDRiOWJkNTA1Y2I1NDM1MDky
|
15
|
+
NzVlMjhhZmZjODA0MDUxNzJlYmU3MTEyNmQ4MTVlYWEwN2YwMTE=
|
data/lib/clacks/service.rb
CHANGED
@@ -127,6 +127,7 @@ module Clacks
|
|
127
127
|
# or until a QUIT signal is received to stop the process.
|
128
128
|
def imap_find(imap)
|
129
129
|
options = Clacks.config[:find_options]
|
130
|
+
delete_after_find = options[:delete_after_find]
|
130
131
|
begin
|
131
132
|
break if stopping?
|
132
133
|
uids = imap.uid_search(options[:keys] || 'ALL')
|
@@ -135,14 +136,14 @@ module Clacks
|
|
135
136
|
uids.reverse! if (options[:what].to_sym == :last && options[:order].to_sym == :asc) ||
|
136
137
|
(options[:what].to_sym != :last && options[:order].to_sym == :desc)
|
137
138
|
processed = 0
|
139
|
+
expunge = false
|
138
140
|
uids.each do |uid|
|
139
141
|
break if stopping?
|
140
142
|
source = imap.uid_fetch(uid, ['RFC822']).first.attr['RFC822']
|
141
|
-
break if stopping?
|
142
143
|
mail = nil
|
143
144
|
begin
|
144
145
|
mail = Mail.new(source)
|
145
|
-
mail.mark_for_delete = true if
|
146
|
+
mail.mark_for_delete = true if delete_after_find
|
146
147
|
Clacks.config[:on_mail].call(mail)
|
147
148
|
rescue Exception => e
|
148
149
|
Clacks.logger.debug(e.message)
|
@@ -150,7 +151,8 @@ module Clacks
|
|
150
151
|
end
|
151
152
|
begin
|
152
153
|
imap.uid_copy(uid, options[:archivebox]) if options[:archivebox]
|
153
|
-
if
|
154
|
+
if delete_after_find && (mail.nil? || mail.is_marked_for_delete?)
|
155
|
+
expunge = true
|
154
156
|
imap.uid_store(uid, "+FLAGS", [Net::IMAP::DELETED])
|
155
157
|
end
|
156
158
|
rescue Exception => e
|
@@ -158,7 +160,7 @@ module Clacks
|
|
158
160
|
end
|
159
161
|
processed += 1
|
160
162
|
end
|
161
|
-
imap.expunge if
|
163
|
+
imap.expunge if expunge
|
162
164
|
end while uids.any? && processed == uids.length
|
163
165
|
end
|
164
166
|
|
data/lib/clacks/version.rb
CHANGED
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: clacks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
version: !binary |-
|
5
|
-
|
5
|
+
MS4wLjY=
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- ITRP
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mail
|