imap-backup 4.1.2 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/email/mboxrd/message.rb +6 -2
- data/lib/imap/backup/thunderbird/mailbox_exporter.rb +10 -1
- data/lib/imap/backup/version.rb +2 -2
- data/lib/thunderbird/subdirectory.rb +3 -6
- metadata +36 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0cd29188ed972abfb2b2ce21d237ce3b7aed5b434717ba64fa2e3475da38ded
|
4
|
+
data.tar.gz: 597b58cdee1ab1b5881ea29111ac85e7fdedfbaa370824d0d24ba1b19c869dcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3adc1984eea76a5ef993a40e89520a01997e6d01357e0a1e41cd4b58a4efc56801fc3d4f8801b95e828ec3a6a1e7884be974aaabf40f921a3faccdc99cf9b98
|
7
|
+
data.tar.gz: 55c0c91fdfb4829ba77be5292b4e475c6ea31e9e6e9ea5abf9702121f8a12c20b9b0105da5e1b97bcb2482105807c614530dea9e058d64af2cde96f7fd19348b
|
data/lib/email/mboxrd/message.rb
CHANGED
@@ -10,7 +10,7 @@ module Email::Mboxrd
|
|
10
10
|
|
11
11
|
attr_reader :supplied_body
|
12
12
|
|
13
|
-
def self.
|
13
|
+
def self.clean_serialized(serialized)
|
14
14
|
cleaned = serialized.gsub(/^>(>*From)/, "\\1")
|
15
15
|
# Serialized messages in this format *should* start with a line
|
16
16
|
# From xxx yy zz
|
@@ -19,7 +19,11 @@ module Email::Mboxrd
|
|
19
19
|
cleaned = cleaned.sub(/^From .*[\r\n]*/, "")
|
20
20
|
end
|
21
21
|
# rubocop:enable Style/IfUnlessModifier
|
22
|
-
|
22
|
+
cleaned
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.from_serialized(serialized)
|
26
|
+
new(clean_serialized(serialized))
|
23
27
|
end
|
24
28
|
|
25
29
|
def initialize(supplied_body)
|
@@ -40,7 +40,16 @@ module Imap::Backup
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
|
43
|
+
File.open(local_folder.full_path, "w") do |f|
|
44
|
+
enumerator = Serializer::MboxEnumerator.new(serializer.mbox_pathname)
|
45
|
+
enumerator.each.with_index do |raw, i|
|
46
|
+
clean = Email::Mboxrd::Message.clean_serialized(raw)
|
47
|
+
timestamp = Time.now.strftime("%a %b %d %H:%M:%S %Y")
|
48
|
+
thunderbird_fom_line = "From - #{timestamp}"
|
49
|
+
output = "#{thunderbird_fom_line}\n#{clean}\n"
|
50
|
+
f.write output
|
51
|
+
end
|
52
|
+
end
|
44
53
|
|
45
54
|
true
|
46
55
|
end
|
data/lib/imap/backup/version.rb
CHANGED
@@ -77,17 +77,14 @@ class Thunderbird::Subdirectory
|
|
77
77
|
|
78
78
|
def check
|
79
79
|
case
|
80
|
-
when placeholder.exists? && !exists?
|
81
|
-
Kernel.puts "Can't set up folder '#{folder_path}': '#{placeholder.path}' exists, but '#{full_path}' is missing"
|
82
|
-
false
|
83
80
|
when exists? && !placeholder.exists?
|
84
|
-
Kernel.puts "Can't set up folder '#{
|
81
|
+
Kernel.puts "Can't set up folder '#{full_path}': '#{full_path}' exists, but '#{placeholder.path}' is missing"
|
85
82
|
false
|
86
83
|
when placeholder.exists? && !placeholder.regular?
|
87
|
-
Kernel.puts "Can't set up folder '#{
|
84
|
+
Kernel.puts "Can't set up folder '#{full_path}': '#{placeholder.path}' exists, but it is not a regular file"
|
88
85
|
false
|
89
86
|
when exists? && !directory?
|
90
|
-
Kernel.puts "Can't set up folder '#{
|
87
|
+
Kernel.puts "Can't set up folder '#{full_path}': '#{full_path}' exists, but it is not a directory"
|
91
88
|
false
|
92
89
|
else
|
93
90
|
true
|
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.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -271,7 +271,7 @@ homepage: https://github.com/joeyates/imap-backup
|
|
271
271
|
licenses:
|
272
272
|
- MIT
|
273
273
|
metadata: {}
|
274
|
-
post_install_message:
|
274
|
+
post_install_message:
|
275
275
|
rdoc_options: []
|
276
276
|
require_paths:
|
277
277
|
- lib
|
@@ -287,46 +287,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
version: '0'
|
288
288
|
requirements: []
|
289
289
|
rubygems_version: 3.1.6
|
290
|
-
signing_key:
|
290
|
+
signing_key:
|
291
291
|
specification_version: 4
|
292
292
|
summary: Backup GMail (or other IMAP) accounts to disk
|
293
293
|
test_files:
|
294
|
-
- spec/
|
295
|
-
- spec/
|
296
|
-
- spec/
|
297
|
-
- spec/
|
298
|
-
- spec/
|
299
|
-
- spec/
|
300
|
-
- spec/
|
301
|
-
- spec/features/backup_spec.rb
|
302
|
-
- spec/support/higline_test_helpers.rb
|
303
|
-
- spec/support/fixtures.rb
|
304
|
-
- spec/support/silence_logging.rb
|
305
|
-
- spec/gather_rspec_coverage.rb
|
306
|
-
- spec/unit/email/provider/gmail_spec.rb
|
307
|
-
- spec/unit/email/provider/fastmail_spec.rb
|
308
|
-
- spec/unit/email/provider/base_spec.rb
|
309
|
-
- spec/unit/email/provider/apple_mail_spec.rb
|
310
|
-
- spec/unit/email/mboxrd/message_spec.rb
|
311
|
-
- spec/unit/email/provider_spec.rb
|
312
|
-
- spec/unit/imap/backup/cli/utils_spec.rb
|
313
|
-
- spec/unit/imap/backup/cli/accounts_spec.rb
|
314
|
-
- spec/unit/imap/backup/cli/local_spec.rb
|
294
|
+
- spec/spec_helper.rb
|
295
|
+
- spec/unit/imap/backup/serializer/mbox_spec.rb
|
296
|
+
- spec/unit/imap/backup/serializer/mbox_store_spec.rb
|
297
|
+
- spec/unit/imap/backup/serializer/mbox_enumerator_spec.rb
|
298
|
+
- spec/unit/imap/backup/setup_spec.rb
|
299
|
+
- spec/unit/imap/backup/logger_spec.rb
|
300
|
+
- spec/unit/imap/backup/configuration_spec.rb
|
315
301
|
- spec/unit/imap/backup/setup/account_spec.rb
|
316
302
|
- spec/unit/imap/backup/setup/connection_tester_spec.rb
|
317
|
-
- spec/unit/imap/backup/setup/folder_chooser_spec.rb
|
318
303
|
- spec/unit/imap/backup/setup/asker_spec.rb
|
319
|
-
- spec/unit/imap/backup/
|
320
|
-
- spec/unit/imap/backup/
|
321
|
-
- spec/unit/imap/backup/
|
322
|
-
- spec/unit/imap/backup/
|
323
|
-
- spec/unit/imap/backup/logger_spec.rb
|
324
|
-
- spec/unit/imap/backup/serializer/mbox_store_spec.rb
|
325
|
-
- spec/unit/imap/backup/serializer/mbox_enumerator_spec.rb
|
326
|
-
- spec/unit/imap/backup/serializer/mbox_spec.rb
|
304
|
+
- spec/unit/imap/backup/setup/folder_chooser_spec.rb
|
305
|
+
- spec/unit/imap/backup/cli/accounts_spec.rb
|
306
|
+
- spec/unit/imap/backup/cli/utils_spec.rb
|
307
|
+
- spec/unit/imap/backup/cli/local_spec.rb
|
327
308
|
- spec/unit/imap/backup/downloader_spec.rb
|
309
|
+
- spec/unit/imap/backup/uploader_spec.rb
|
328
310
|
- spec/unit/imap/backup/account/folder_spec.rb
|
329
311
|
- spec/unit/imap/backup/account/connection_spec.rb
|
312
|
+
- spec/unit/imap/backup/utils_spec.rb
|
330
313
|
- spec/unit/imap/backup/client/default_spec.rb
|
331
|
-
- spec/
|
314
|
+
- spec/unit/email/mboxrd/message_spec.rb
|
315
|
+
- spec/unit/email/provider/gmail_spec.rb
|
316
|
+
- spec/unit/email/provider/apple_mail_spec.rb
|
317
|
+
- spec/unit/email/provider/fastmail_spec.rb
|
318
|
+
- spec/unit/email/provider/base_spec.rb
|
319
|
+
- spec/unit/email/provider_spec.rb
|
320
|
+
- spec/features/backup_spec.rb
|
321
|
+
- spec/features/helper.rb
|
322
|
+
- spec/features/restore_spec.rb
|
323
|
+
- spec/features/status_spec.rb
|
324
|
+
- spec/features/support/email_server.rb
|
325
|
+
- spec/features/support/backup_directory.rb
|
326
|
+
- spec/features/support/shared/connection_context.rb
|
327
|
+
- spec/features/support/shared/message_fixtures.rb
|
328
|
+
- spec/support/fixtures.rb
|
329
|
+
- spec/support/silence_logging.rb
|
330
|
+
- spec/support/higline_test_helpers.rb
|
332
331
|
- spec/fixtures/connection.yml
|
332
|
+
- spec/gather_rspec_coverage.rb
|