imap-backup 9.0.1.rc1 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/development.md +1 -1
- data/lib/imap/backup/account/connection/backup_folders.rb +12 -12
- data/lib/imap/backup/cli/backup.rb +6 -0
- data/lib/imap/backup/mirror/map.rb +10 -0
- data/lib/imap/backup/version.rb +3 -3
- metadata +4 -7
- data/docs/configuration.md +0 -25
- data/docs/restore.md +0 -28
- data/docs/setup.md +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e9d95502af3aa99d3ad49581ff743c641d12f308a1326ba2aabc1dcc2ec5f4f
|
4
|
+
data.tar.gz: ddf93a5e5bcc90ef698607b53224f5082da7cd0a7f65b52e0bf892999bb96898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 582736b8992988cb3d34c48022cf59044d92c8c9488a133afe49610f4abf8853a98c31eb6c61e677d47363252dcbf5a2b923646b2643dd059bd71923a06e652f
|
7
|
+
data.tar.gz: 11ba0236028272763b078aa0e9d84d636fcb98478a7d225c1c8406c771838d158fd218ba259697a2aac7ead306d9fe13eb89f2aec1712d7416ff7afca86beb4e
|
data/docs/development.md
CHANGED
@@ -14,24 +14,24 @@ module Imap::Backup
|
|
14
14
|
def run
|
15
15
|
all_names = Account::Connection::FolderNames.new(client: client, account: account).run
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
configured =
|
18
|
+
case
|
19
|
+
when account.folders&.any?
|
19
20
|
account.folders.map { |af| af[:name] }
|
21
|
+
when account.folder_blacklist
|
22
|
+
[]
|
20
23
|
else
|
21
24
|
all_names
|
22
25
|
end
|
23
26
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
next if !backup
|
27
|
+
names =
|
28
|
+
if account.folder_blacklist
|
29
|
+
all_names - configured
|
30
|
+
else
|
31
|
+
all_names & configured
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
end.compact
|
34
|
+
names.map { |name| Account::Folder.new(account.connection, name) }
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -15,6 +15,12 @@ module Imap::Backup
|
|
15
15
|
config = load_config(**options)
|
16
16
|
each_connection(config, emails) do |connection|
|
17
17
|
connection.run_backup(refresh: refresh)
|
18
|
+
rescue StandardError => e
|
19
|
+
message =
|
20
|
+
"Backup for account '#{connection.account.username}' " \
|
21
|
+
"failed with error #{e}"
|
22
|
+
Logger.logger.warn message
|
23
|
+
next
|
18
24
|
end
|
19
25
|
end
|
20
26
|
|
@@ -33,14 +33,24 @@ module Imap::Backup
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def source_uid(destination_uid)
|
36
|
+
if destination_store == {}
|
37
|
+
raise "Assign UID validities with #reset before calling #source_uid"
|
38
|
+
end
|
39
|
+
|
36
40
|
map.key(destination_uid)
|
37
41
|
end
|
38
42
|
|
39
43
|
def destination_uid(source_uid)
|
44
|
+
if destination_store == {}
|
45
|
+
raise "Assign UID validities with #reset before calling #destination_uid"
|
46
|
+
end
|
47
|
+
|
40
48
|
map[source_uid]
|
41
49
|
end
|
42
50
|
|
43
51
|
def map_uids(source:, destination:)
|
52
|
+
raise "Assign UID validities with #reset before calling #map_uids" if destination_store == {}
|
53
|
+
|
44
54
|
map[source] = destination
|
45
55
|
end
|
46
56
|
|
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: 9.
|
4
|
+
version: 9.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -217,11 +217,8 @@ files:
|
|
217
217
|
- LICENSE
|
218
218
|
- README.md
|
219
219
|
- bin/imap-backup
|
220
|
-
- docs/configuration.md
|
221
220
|
- docs/delimiters-and-prefixes.md
|
222
221
|
- docs/development.md
|
223
|
-
- docs/restore.md
|
224
|
-
- docs/setup.md
|
225
222
|
- imap-backup.gemspec
|
226
223
|
- lib/cli_coverage.rb
|
227
224
|
- lib/email/mboxrd/message.rb
|
@@ -301,9 +298,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
301
298
|
version: '2.6'
|
302
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
300
|
requirements:
|
304
|
-
- - "
|
301
|
+
- - ">="
|
305
302
|
- !ruby/object:Gem::Version
|
306
|
-
version:
|
303
|
+
version: '0'
|
307
304
|
requirements: []
|
308
305
|
rubygems_version: 3.3.7
|
309
306
|
signing_key:
|
data/docs/configuration.md
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
Configuration is stored in a JSON file.
|
2
|
-
|
3
|
-
The format is documented [here](files/config.md).
|
4
|
-
|
5
|
-
# Folders
|
6
|
-
|
7
|
-
By default, all folders are backed-up. You can override this by choosing
|
8
|
-
specific folders.
|
9
|
-
|
10
|
-
# Connection options
|
11
|
-
|
12
|
-
You can override the parameters passed to `Net::IMAP` with `connection_options`.
|
13
|
-
|
14
|
-
See the Ruby Standard Library documentation for `Net::IMAP` of details of [supported parameters](https://ruby-doc.org/stdlib-3.1.2/libdoc/net-imap/rdoc/Net/IMAP.html#method-c-new).
|
15
|
-
|
16
|
-
Specifically, if you are using a self-signed certificate and get SSL errors, e.g.
|
17
|
-
`certificate verify failed`, you can choose to not verify the TLS connection.
|
18
|
-
|
19
|
-
Connection options can be entered via `imap-backup setup` as JSON.
|
20
|
-
|
21
|
-
Choose the account, then 'modify connection options'.
|
22
|
-
|
23
|
-
For example:
|
24
|
-
|
25
|
-
![Entering connection options as JSON](./images/entering-connection-options-as-json.png "Entering connection options as JSON")
|
data/docs/restore.md
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# FAQ
|
2
|
-
|
3
|
-
# How does restore work?
|
4
|
-
|
5
|
-
Backed-up emails are pushed to the IMAP server.
|
6
|
-
If there are clashes, folders are renamed.
|
7
|
-
|
8
|
-
# What are all these 'INBOX.12345' files?
|
9
|
-
|
10
|
-
If, when the backup is launched, the IMAP server contains a folder with
|
11
|
-
the same name, but different history to the local backup, the local
|
12
|
-
emails cannot simply be added to the existing folder.
|
13
|
-
|
14
|
-
In this case, a numeric suffix is added to the **local** folder,
|
15
|
-
before it is restored.
|
16
|
-
|
17
|
-
In this way, old and new emails are kept separate.
|
18
|
-
|
19
|
-
# Will my email get overwritten?
|
20
|
-
|
21
|
-
No.
|
22
|
-
|
23
|
-
Emails are identified by folder and a specific email id. Any email that
|
24
|
-
is already on the server is skipped.
|
25
|
-
|
26
|
-
## How do I restore to a different service?
|
27
|
-
|
28
|
-
It is best to use the `migrate` command in this case.
|