imap-backup 4.0.1 → 4.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/docs/development.md +5 -12
- data/imap-backup.gemspec +1 -4
- data/lib/email/mboxrd/message.rb +6 -2
- data/lib/email/provider/apple_mail.rb +7 -0
- data/lib/email/provider/base.rb +8 -0
- data/lib/email/provider/fastmail.rb +7 -0
- data/lib/email/provider/gmail.rb +7 -0
- data/lib/email/provider/unknown.rb +11 -0
- data/lib/email/provider.rb +16 -26
- data/lib/imap/backup/account/connection.rb +19 -29
- data/lib/imap/backup/account/folder.rb +9 -10
- data/lib/imap/backup/account.rb +103 -0
- data/lib/imap/backup/cli/helpers.rb +14 -0
- data/lib/imap/backup/cli/local.rb +19 -25
- data/lib/imap/backup/cli/utils.rb +67 -10
- data/lib/imap/backup/client/apple_mail.rb +11 -0
- data/lib/imap/backup/client/default.rb +51 -0
- data/lib/imap/backup/configuration/account.rb +3 -1
- data/lib/imap/backup/configuration/connection_tester.rb +1 -1
- data/lib/imap/backup/configuration/store.rb +10 -5
- data/lib/imap/backup/downloader.rb +3 -4
- data/lib/imap/backup/serializer/mbox.rb +5 -0
- data/lib/imap/backup/serializer/mbox_store.rb +8 -8
- data/lib/imap/backup/thunderbird/mailbox_exporter.rb +58 -0
- data/lib/imap/backup/version.rb +1 -1
- data/lib/imap/backup.rb +1 -0
- data/lib/thunderbird/install.rb +16 -0
- data/lib/thunderbird/local_folder.rb +65 -0
- data/lib/thunderbird/profile.rb +30 -0
- data/lib/thunderbird/profiles.rb +71 -0
- data/lib/thunderbird/subdirectory.rb +96 -0
- data/lib/thunderbird/subdirectory_placeholder.rb +21 -0
- data/lib/thunderbird.rb +14 -0
- data/spec/features/restore_spec.rb +1 -1
- data/spec/features/support/email_server.rb +2 -2
- data/spec/unit/email/provider/apple_mail_spec.rb +7 -0
- data/spec/unit/email/provider/base_spec.rb +11 -0
- data/spec/unit/email/provider/fastmail_spec.rb +7 -0
- data/spec/unit/email/provider/gmail_spec.rb +7 -0
- data/spec/unit/email/provider_spec.rb +12 -25
- data/spec/unit/imap/backup/account/connection_spec.rb +26 -51
- data/spec/unit/imap/backup/account/folder_spec.rb +22 -22
- data/spec/unit/imap/backup/cli/local_spec.rb +70 -0
- data/spec/unit/imap/backup/cli/utils_spec.rb +50 -0
- data/spec/unit/imap/backup/client/default_spec.rb +22 -0
- data/spec/unit/imap/backup/configuration/connection_tester_spec.rb +3 -3
- data/spec/unit/imap/backup/configuration/store_spec.rb +25 -12
- data/spec/unit/imap/backup/downloader_spec.rb +1 -2
- metadata +68 -30
@@ -1,4 +1,5 @@
|
|
1
1
|
require "json"
|
2
|
+
require "os"
|
2
3
|
|
3
4
|
# rubocop:disable RSpec/PredicateMatcher
|
4
5
|
|
@@ -189,10 +190,16 @@ describe Imap::Backup::Configuration::Store do
|
|
189
190
|
end
|
190
191
|
|
191
192
|
context "when file permissions are too open" do
|
192
|
-
|
193
|
-
|
193
|
+
context "when on UNIX" do
|
194
|
+
before do
|
195
|
+
allow(OS).to receive(:windows?) { false }
|
196
|
+
end
|
194
197
|
|
195
|
-
|
198
|
+
it "sets them to 0600" do
|
199
|
+
expect(FileUtils).to receive(:chmod).with(0o600, file_path)
|
200
|
+
|
201
|
+
subject.save
|
202
|
+
end
|
196
203
|
end
|
197
204
|
end
|
198
205
|
|
@@ -206,18 +213,24 @@ describe Imap::Backup::Configuration::Store do
|
|
206
213
|
end
|
207
214
|
end
|
208
215
|
|
209
|
-
context "when
|
210
|
-
let(:file_exists) { true }
|
211
|
-
|
216
|
+
context "when on UNIX" do
|
212
217
|
before do
|
213
|
-
allow(
|
214
|
-
with(file_path, 0o600).and_raise("Error")
|
218
|
+
allow(OS).to receive(:windows?) { false }
|
215
219
|
end
|
216
220
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
+
context "when the config file permissions are too lax" do
|
222
|
+
let(:file_exists) { true }
|
223
|
+
|
224
|
+
before do
|
225
|
+
allow(Imap::Backup::Utils).to receive(:check_permissions).
|
226
|
+
with(file_path, 0o600).and_raise("Error")
|
227
|
+
end
|
228
|
+
|
229
|
+
it "fails" do
|
230
|
+
expect do
|
231
|
+
subject.save
|
232
|
+
end.to raise_error(RuntimeError, "Error")
|
233
|
+
end
|
221
234
|
end
|
222
235
|
end
|
223
236
|
end
|
@@ -3,11 +3,10 @@ describe Imap::Backup::Downloader do
|
|
3
3
|
subject { described_class.new(folder, serializer) }
|
4
4
|
|
5
5
|
let(:body) { "blah" }
|
6
|
-
let(:message) { {"RFC822" => body} }
|
7
6
|
let(:folder) do
|
8
7
|
instance_double(
|
9
8
|
Imap::Backup::Account::Folder,
|
10
|
-
fetch:
|
9
|
+
fetch: body,
|
11
10
|
name: "folder",
|
12
11
|
uids: folder_uids
|
13
12
|
)
|
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: 4.0.
|
4
|
+
version: 4.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: os
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,11 +170,7 @@ email:
|
|
156
170
|
executables:
|
157
171
|
- imap-backup
|
158
172
|
extensions: []
|
159
|
-
extra_rdoc_files:
|
160
|
-
- README.md
|
161
|
-
- docs/setup.md
|
162
|
-
- docs/restore.md
|
163
|
-
- docs/development.md
|
173
|
+
extra_rdoc_files: []
|
164
174
|
files:
|
165
175
|
- LICENSE
|
166
176
|
- README.md
|
@@ -171,7 +181,13 @@ files:
|
|
171
181
|
- imap-backup.gemspec
|
172
182
|
- lib/email/mboxrd/message.rb
|
173
183
|
- lib/email/provider.rb
|
184
|
+
- lib/email/provider/apple_mail.rb
|
185
|
+
- lib/email/provider/base.rb
|
186
|
+
- lib/email/provider/fastmail.rb
|
187
|
+
- lib/email/provider/gmail.rb
|
188
|
+
- lib/email/provider/unknown.rb
|
174
189
|
- lib/imap/backup.rb
|
190
|
+
- lib/imap/backup/account.rb
|
175
191
|
- lib/imap/backup/account/connection.rb
|
176
192
|
- lib/imap/backup/account/folder.rb
|
177
193
|
- lib/imap/backup/cli.rb
|
@@ -183,6 +199,8 @@ files:
|
|
183
199
|
- lib/imap/backup/cli/setup.rb
|
184
200
|
- lib/imap/backup/cli/status.rb
|
185
201
|
- lib/imap/backup/cli/utils.rb
|
202
|
+
- lib/imap/backup/client/apple_mail.rb
|
203
|
+
- lib/imap/backup/client/default.rb
|
186
204
|
- lib/imap/backup/configuration/account.rb
|
187
205
|
- lib/imap/backup/configuration/asker.rb
|
188
206
|
- lib/imap/backup/configuration/connection_tester.rb
|
@@ -195,10 +213,18 @@ files:
|
|
195
213
|
- lib/imap/backup/serializer/mbox.rb
|
196
214
|
- lib/imap/backup/serializer/mbox_enumerator.rb
|
197
215
|
- lib/imap/backup/serializer/mbox_store.rb
|
216
|
+
- lib/imap/backup/thunderbird/mailbox_exporter.rb
|
198
217
|
- lib/imap/backup/uploader.rb
|
199
218
|
- lib/imap/backup/utils.rb
|
200
219
|
- lib/imap/backup/version.rb
|
201
220
|
- lib/retry_on_error.rb
|
221
|
+
- lib/thunderbird.rb
|
222
|
+
- lib/thunderbird/install.rb
|
223
|
+
- lib/thunderbird/local_folder.rb
|
224
|
+
- lib/thunderbird/profile.rb
|
225
|
+
- lib/thunderbird/profiles.rb
|
226
|
+
- lib/thunderbird/subdirectory.rb
|
227
|
+
- lib/thunderbird/subdirectory_placeholder.rb
|
202
228
|
- spec/features/backup_spec.rb
|
203
229
|
- spec/features/helper.rb
|
204
230
|
- spec/features/restore_spec.rb
|
@@ -214,9 +240,16 @@ files:
|
|
214
240
|
- spec/support/shared_examples/account_flagging.rb
|
215
241
|
- spec/support/silence_logging.rb
|
216
242
|
- spec/unit/email/mboxrd/message_spec.rb
|
243
|
+
- spec/unit/email/provider/apple_mail_spec.rb
|
244
|
+
- spec/unit/email/provider/base_spec.rb
|
245
|
+
- spec/unit/email/provider/fastmail_spec.rb
|
246
|
+
- spec/unit/email/provider/gmail_spec.rb
|
217
247
|
- spec/unit/email/provider_spec.rb
|
218
248
|
- spec/unit/imap/backup/account/connection_spec.rb
|
219
249
|
- spec/unit/imap/backup/account/folder_spec.rb
|
250
|
+
- spec/unit/imap/backup/cli/local_spec.rb
|
251
|
+
- spec/unit/imap/backup/cli/utils_spec.rb
|
252
|
+
- spec/unit/imap/backup/client/default_spec.rb
|
220
253
|
- spec/unit/imap/backup/configuration/account_spec.rb
|
221
254
|
- spec/unit/imap/backup/configuration/asker_spec.rb
|
222
255
|
- spec/unit/imap/backup/configuration/connection_tester_spec.rb
|
@@ -236,9 +269,7 @@ licenses:
|
|
236
269
|
- MIT
|
237
270
|
metadata: {}
|
238
271
|
post_install_message:
|
239
|
-
rdoc_options:
|
240
|
-
- "--main"
|
241
|
-
- README.md
|
272
|
+
rdoc_options: []
|
242
273
|
require_paths:
|
243
274
|
- lib
|
244
275
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -252,40 +283,47 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
283
|
- !ruby/object:Gem::Version
|
253
284
|
version: '0'
|
254
285
|
requirements: []
|
255
|
-
rubygems_version: 3.1.
|
286
|
+
rubygems_version: 3.1.2
|
256
287
|
signing_key:
|
257
288
|
specification_version: 4
|
258
289
|
summary: Backup GMail (or other IMAP) accounts to disk
|
259
290
|
test_files:
|
260
291
|
- spec/spec_helper.rb
|
292
|
+
- spec/fixtures/connection.yml
|
293
|
+
- spec/unit/email/provider/gmail_spec.rb
|
294
|
+
- spec/unit/email/provider/apple_mail_spec.rb
|
295
|
+
- spec/unit/email/provider/fastmail_spec.rb
|
296
|
+
- spec/unit/email/provider/base_spec.rb
|
297
|
+
- spec/unit/email/provider_spec.rb
|
298
|
+
- spec/unit/email/mboxrd/message_spec.rb
|
261
299
|
- spec/unit/imap/backup_spec.rb
|
262
|
-
- spec/unit/imap/backup/
|
263
|
-
- spec/unit/imap/backup/
|
300
|
+
- spec/unit/imap/backup/cli/utils_spec.rb
|
301
|
+
- spec/unit/imap/backup/cli/local_spec.rb
|
302
|
+
- spec/unit/imap/backup/utils_spec.rb
|
303
|
+
- spec/unit/imap/backup/client/default_spec.rb
|
304
|
+
- spec/unit/imap/backup/downloader_spec.rb
|
305
|
+
- spec/unit/imap/backup/configuration/store_spec.rb
|
264
306
|
- spec/unit/imap/backup/configuration/connection_tester_spec.rb
|
265
|
-
- spec/unit/imap/backup/configuration/setup_spec.rb
|
266
307
|
- spec/unit/imap/backup/configuration/asker_spec.rb
|
308
|
+
- spec/unit/imap/backup/configuration/setup_spec.rb
|
267
309
|
- spec/unit/imap/backup/configuration/folder_chooser_spec.rb
|
268
|
-
- spec/unit/imap/backup/configuration/
|
310
|
+
- spec/unit/imap/backup/configuration/account_spec.rb
|
311
|
+
- spec/unit/imap/backup/configuration/list_spec.rb
|
312
|
+
- spec/unit/imap/backup/account/folder_spec.rb
|
313
|
+
- spec/unit/imap/backup/account/connection_spec.rb
|
269
314
|
- spec/unit/imap/backup/serializer/mbox_spec.rb
|
270
315
|
- spec/unit/imap/backup/serializer/mbox_store_spec.rb
|
271
316
|
- spec/unit/imap/backup/serializer/mbox_enumerator_spec.rb
|
272
|
-
- spec/unit/imap/backup/downloader_spec.rb
|
273
317
|
- spec/unit/imap/backup/uploader_spec.rb
|
274
|
-
- spec/
|
275
|
-
- spec/
|
276
|
-
- spec/
|
277
|
-
- spec/
|
278
|
-
- spec/
|
318
|
+
- spec/support/fixtures.rb
|
319
|
+
- spec/support/shared_examples/account_flagging.rb
|
320
|
+
- spec/support/higline_test_helpers.rb
|
321
|
+
- spec/support/silence_logging.rb
|
322
|
+
- spec/gather_rspec_coverage.rb
|
279
323
|
- spec/features/backup_spec.rb
|
280
324
|
- spec/features/helper.rb
|
281
|
-
- spec/features/restore_spec.rb
|
282
|
-
- spec/features/support/email_server.rb
|
283
325
|
- spec/features/support/backup_directory.rb
|
284
|
-
- spec/features/support/shared/connection_context.rb
|
285
326
|
- spec/features/support/shared/message_fixtures.rb
|
286
|
-
- spec/support/
|
287
|
-
- spec/support/
|
288
|
-
- spec/
|
289
|
-
- spec/support/shared_examples/account_flagging.rb
|
290
|
-
- spec/fixtures/connection.yml
|
291
|
-
- spec/gather_rspec_coverage.rb
|
327
|
+
- spec/features/support/shared/connection_context.rb
|
328
|
+
- spec/features/support/email_server.rb
|
329
|
+
- spec/features/restore_spec.rb
|