imap-backup 6.1.0 → 6.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imap/backup/account/connection.rb +8 -1
- data/lib/imap/backup/client/default.rb +26 -2
- data/lib/imap/backup/migrator.rb +5 -1
- data/lib/imap/backup/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0d36730de07aa607526d3a37dc985089fa0ab41418e811edee58b7e88ba2762
|
4
|
+
data.tar.gz: e91d2b8f28ebd05a8b15f9e34c1b52648a937237b44e6eeee093e7996bf1232c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af9e727577ad646f44b9fbae4d3e0d0f0f6cd9712f9d53e95f07b443c7eb87e99958c083416fc87c2000606936422b5ce9413578326673663390cac6ba2c11a
|
7
|
+
data.tar.gz: 176f00ebb3325900e040734599a7be3b9f6c9141c11ff358cd85bc70baf094c00b1d2753d7f2136b715d4839b0fa7bb84d237104f9b96df51b73dafd33e35b2f
|
@@ -39,7 +39,14 @@ module Imap::Backup
|
|
39
39
|
client
|
40
40
|
ensure_account_folder
|
41
41
|
each_folder do |folder, serializer|
|
42
|
-
|
42
|
+
begin
|
43
|
+
next if !folder.exist?
|
44
|
+
rescue Encoding::UndefinedConversionError
|
45
|
+
message = "Skipping backup for '#{folder.name}' " \
|
46
|
+
"as it is not UTF-7 encoded correctly"
|
47
|
+
Logger.logger.info message
|
48
|
+
next
|
49
|
+
end
|
43
50
|
|
44
51
|
Logger.logger.debug "[#{folder.name}] running backup"
|
45
52
|
serializer.apply_uid_validity(folder.uid_validity)
|
@@ -7,14 +7,16 @@ module Imap::Backup
|
|
7
7
|
class Client::Default
|
8
8
|
extend Forwardable
|
9
9
|
def_delegators :imap, *%i(
|
10
|
-
append authenticate create
|
11
|
-
|
10
|
+
append authenticate create expunge login
|
11
|
+
responses uid_fetch uid_search uid_store
|
12
12
|
)
|
13
13
|
|
14
14
|
attr_reader :args
|
15
|
+
attr_accessor :state
|
15
16
|
|
16
17
|
def initialize(*args)
|
17
18
|
@args = args
|
19
|
+
@state = nil
|
18
20
|
end
|
19
21
|
|
20
22
|
def list
|
@@ -26,6 +28,28 @@ module Imap::Backup
|
|
26
28
|
mailbox_lists.map { |ml| extract_name(ml) }
|
27
29
|
end
|
28
30
|
|
31
|
+
# Track mailbox selection during delegation to Net::IMAP instance
|
32
|
+
|
33
|
+
def disconnect
|
34
|
+
imap.disconnect
|
35
|
+
self.state = nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def examine(mailbox)
|
39
|
+
return if state == [:examine, mailbox]
|
40
|
+
|
41
|
+
result = imap.examine(mailbox)
|
42
|
+
self.state = [:examine, mailbox]
|
43
|
+
result
|
44
|
+
end
|
45
|
+
|
46
|
+
def select(mailbox)
|
47
|
+
return if state == [:select, mailbox]
|
48
|
+
|
49
|
+
imap.select(mailbox)
|
50
|
+
self.state = [:select, mailbox]
|
51
|
+
end
|
52
|
+
|
29
53
|
private
|
30
54
|
|
31
55
|
def imap
|
data/lib/imap/backup/migrator.rb
CHANGED
@@ -24,7 +24,11 @@ module Imap::Backup
|
|
24
24
|
"#{log_prefix} #{message.supplied_body.size} bytes"
|
25
25
|
)
|
26
26
|
|
27
|
-
|
27
|
+
begin
|
28
|
+
folder.append(message)
|
29
|
+
rescue StandardError => e
|
30
|
+
Logger.logger.warn "#{log_prefix} append error: #{e}"
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
data/lib/imap/backup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imap-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1
|
4
|
+
version: 6.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|