imap-backup 9.3.2 → 9.4.0.pre1
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 +0 -6
- data/lib/email/mboxrd/message.rb +13 -5
- data/lib/imap/backup/cli.rb +0 -13
- data/lib/imap/backup/serializer.rb +3 -9
- data/lib/imap/backup/version.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd7a94d72f09a4364d3fd424b2e7fabbf4885726b07f0ffbb3e28a6a08e1507f
|
4
|
+
data.tar.gz: ddc3624e1e7441422b93be0d5b651b80b4e7f78268e267573338cec557de2ae2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09734ca2ee62e60830358a0d5404d2a5d4f8b8f47b1002cf5373c41a6f4f42cbd3487c66fd7c964c193b41b5b99fa81a173ae3061d43ebcfd8ca56eaee66010d'
|
7
|
+
data.tar.gz: 1ebccf8170e1830222ba9f720be48668b067288bfe89754a98f0bc0146ed96086e8df2fb943c4ecd4f7ed7c4d75297b456a61f96225701e74d79c7aaba39529d
|
data/docs/development.md
CHANGED
data/lib/email/mboxrd/message.rb
CHANGED
@@ -38,7 +38,7 @@ module Email::Mboxrd
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def subject
|
41
|
-
parsed.subject
|
41
|
+
parsed.subject&.force_encoding(Encoding::ASCII_8BIT)
|
42
42
|
end
|
43
43
|
|
44
44
|
def imap_body
|
@@ -62,9 +62,8 @@ module Email::Mboxrd
|
|
62
62
|
|
63
63
|
def best_from
|
64
64
|
return first_from if first_from
|
65
|
-
return
|
66
|
-
return
|
67
|
-
return parsed.return_path if parsed.return_path
|
65
|
+
return sender if sender
|
66
|
+
return return_path if return_path
|
68
67
|
|
69
68
|
""
|
70
69
|
end
|
@@ -72,7 +71,16 @@ module Email::Mboxrd
|
|
72
71
|
def first_from
|
73
72
|
return nil if !parsed.from.is_a?(Enumerable)
|
74
73
|
|
75
|
-
parsed.from.
|
74
|
+
first = parsed.from.compact.first
|
75
|
+
first&.force_encoding(Encoding::ASCII_8BIT)
|
76
|
+
end
|
77
|
+
|
78
|
+
def return_path
|
79
|
+
parsed.return_path&.force_encoding(Encoding::ASCII_8BIT)
|
80
|
+
end
|
81
|
+
|
82
|
+
def sender
|
83
|
+
parsed.sender&.force_encoding(Encoding::ASCII_8BIT)
|
76
84
|
end
|
77
85
|
|
78
86
|
def mboxrd_body
|
data/lib/imap/backup/cli.rb
CHANGED
@@ -20,17 +20,9 @@ module Imap::Backup
|
|
20
20
|
|
21
21
|
include Helpers
|
22
22
|
|
23
|
-
VERSION_ARGUMENTS = %w(-v --version).freeze
|
24
|
-
|
25
23
|
default_task :backup
|
26
24
|
|
27
25
|
def self.start(*args)
|
28
|
-
version_argument = ARGV & VERSION_ARGUMENTS
|
29
|
-
if version_argument.any?
|
30
|
-
new.version
|
31
|
-
exit 0
|
32
|
-
end
|
33
|
-
|
34
26
|
# By default, commands like `imap-backup help foo bar`
|
35
27
|
# are handled by listing all `foo` methods, whereas the user
|
36
28
|
# probably wants the detailed help for the `bar` method.
|
@@ -235,10 +227,5 @@ module Imap::Backup
|
|
235
227
|
|
236
228
|
desc "utils SUBCOMMAND [OPTIONS]", "Various utilities"
|
237
229
|
subcommand "utils", Utils
|
238
|
-
|
239
|
-
desc "version", "Print the imap-backup version"
|
240
|
-
def version
|
241
|
-
Kernel.puts "imap-backup #{Imap::Backup::VERSION}"
|
242
|
-
end
|
243
230
|
end
|
244
231
|
end
|
@@ -30,20 +30,14 @@ module Imap::Backup
|
|
30
30
|
def initialize(path, folder)
|
31
31
|
@path = path
|
32
32
|
@folder = folder
|
33
|
-
@validated = nil
|
34
33
|
end
|
35
34
|
|
36
35
|
# Returns true if there are existing, valid files
|
37
36
|
# false otherwise (in which case any existing files are deleted)
|
38
37
|
def validate!
|
39
|
-
return if @validated
|
40
|
-
|
41
38
|
optionally_migrate2to3
|
42
39
|
|
43
|
-
if imap.valid? && mbox.valid?
|
44
|
-
@validated = true
|
45
|
-
return true
|
46
|
-
end
|
40
|
+
return true if imap.valid? && mbox.valid?
|
47
41
|
|
48
42
|
delete
|
49
43
|
|
@@ -119,7 +113,7 @@ module Imap::Backup
|
|
119
113
|
# NOOP
|
120
114
|
nil
|
121
115
|
else
|
122
|
-
apply_new_uid_validity
|
116
|
+
apply_new_uid_validity value
|
123
117
|
end
|
124
118
|
end
|
125
119
|
|
@@ -222,7 +216,7 @@ module Imap::Backup
|
|
222
216
|
Logger.logger.info <<~MESSAGE
|
223
217
|
Local metadata for folder '#{folder_path}' is currently stored in the version 2 format.
|
224
218
|
|
225
|
-
|
219
|
+
Migrating the version 3 format...
|
226
220
|
MESSAGE
|
227
221
|
|
228
222
|
migrator.run
|
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.4.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -300,9 +300,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
300
300
|
version: '2.6'
|
301
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
302
302
|
requirements:
|
303
|
-
- - "
|
303
|
+
- - ">"
|
304
304
|
- !ruby/object:Gem::Version
|
305
|
-
version:
|
305
|
+
version: 1.3.1
|
306
306
|
requirements: []
|
307
307
|
rubygems_version: 3.3.7
|
308
308
|
signing_key:
|