mournmail 2 → 3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mournmail/config.rb +8 -6
- data/lib/mournmail/draft_mode.rb +9 -3
- data/lib/mournmail/message_mode.rb +4 -7
- data/lib/mournmail/utils.rb +6 -1
- data/lib/mournmail/version.rb +1 -1
- 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: 410f91625278d6121b3f4f0c2253595b294e66b4a0149ce6af53afaaac8a2747
|
|
4
|
+
data.tar.gz: 2e052315c79594fc4a7946142efce5ff3f04b288e223c4d569f6b7cee423e95d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3e8e9a07573cacb0f5de41c5055589040a75a6ef2e9b8315e86744efea7f0c11b74cbed2d4c0e92bf4cee724bad183439d5c61b4a7b6f024eb48afe26005db4
|
|
7
|
+
data.tar.gz: a51657c1ec942e4dd19f8982bfec92566f77c505b25988dd72dd20d8a1869a73ecbe752b682ca0cdae08c5fc5981b710b9b0e2df49f7e9ebe4b8d701e5b8f5a5
|
data/lib/mournmail/config.rb
CHANGED
|
@@ -26,14 +26,14 @@ module Textbringer
|
|
|
26
26
|
CONFIG[:mournmail_keep_alive_interval] = 60
|
|
27
27
|
case RUBY_PLATFORM
|
|
28
28
|
when /mswin|mingw/
|
|
29
|
-
CONFIG[:
|
|
30
|
-
CONFIG[:
|
|
29
|
+
CONFIG[:mournmail_file_open_command] = "start"
|
|
30
|
+
CONFIG[:mournmail_link_open_command] = "start"
|
|
31
31
|
when /darwin/
|
|
32
|
-
CONFIG[:
|
|
33
|
-
CONFIG[:
|
|
32
|
+
CONFIG[:mournmail_file_open_command] = "open"
|
|
33
|
+
CONFIG[:mournmail_link_open_command] = "open"
|
|
34
34
|
else
|
|
35
|
-
CONFIG[:
|
|
36
|
-
CONFIG[:
|
|
35
|
+
CONFIG[:mournmail_file_open_command] = "xdg-open"
|
|
36
|
+
CONFIG[:mournmail_link_open_command] = "xdg-open"
|
|
37
37
|
end
|
|
38
38
|
CONFIG[:mournmail_addresses_path] = File.expand_path("~/.addresses")
|
|
39
39
|
CONFIG[:mournmail_signature_regexp] = /^-- /
|
|
@@ -69,4 +69,6 @@ module Textbringer
|
|
|
69
69
|
CONFIG[:mournmail_summary_line_limit] = 78
|
|
70
70
|
CONFIG[:mournmail_summary_from_limit] = 16
|
|
71
71
|
CONFIG[:mournmail_summary_use_line_cache] = true
|
|
72
|
+
CONFIG[:mournmail_smtp_open_timeout] = 30
|
|
73
|
+
CONFIG[:mournmail_smtp_read_timeout] = 60
|
|
72
74
|
end
|
data/lib/mournmail/draft_mode.rb
CHANGED
|
@@ -76,16 +76,22 @@ module Mournmail
|
|
|
76
76
|
account = @buffer[:mournmail_delivery_account] ||
|
|
77
77
|
Mournmail.current_account
|
|
78
78
|
conf = CONFIG[:mournmail_accounts][account]
|
|
79
|
+
delivery_method = @buffer[:mournmail_delivery_method] ||
|
|
80
|
+
conf[:delivery_method]
|
|
79
81
|
options = @buffer[:mournmail_delivery_options] ||
|
|
80
82
|
conf[:delivery_options]
|
|
83
|
+
if delivery_method == :smtp
|
|
84
|
+
options = {
|
|
85
|
+
open_timeout: CONFIG[:mournmail_smtp_open_timeout],
|
|
86
|
+
read_timeout: CONFIG[:mournmail_smtp_read_timeout],
|
|
87
|
+
}.merge(options)
|
|
88
|
+
end
|
|
81
89
|
if options[:authentication] == "gmail"
|
|
82
90
|
token = Mournmail.google_access_token(account)
|
|
83
91
|
options = options.merge(authentication: "xoauth2",
|
|
84
92
|
password: token)
|
|
85
93
|
end
|
|
86
|
-
m.delivery_method(
|
|
87
|
-
conf[:delivery_method],
|
|
88
|
-
options)
|
|
94
|
+
m.delivery_method(delivery_method, options)
|
|
89
95
|
bury_buffer(@buffer)
|
|
90
96
|
Mournmail.background do
|
|
91
97
|
begin
|
|
@@ -11,10 +11,7 @@ module Mournmail
|
|
|
11
11
|
MESSAGE_MODE_MAP.define_key("\t", :message_next_link_or_part_command)
|
|
12
12
|
|
|
13
13
|
# See http://nihongo.jp/support/mail_guide/dev_guide.txt
|
|
14
|
-
URI_REGEXP =
|
|
15
|
-
URI.regexp("https"),
|
|
16
|
-
URI.regexp("ftp"),
|
|
17
|
-
URI.regexp("mailto"))
|
|
14
|
+
URI_REGEXP = URI::RFC2396_PARSER.make_regexp(["http", "https", "ftp", "mailto"])
|
|
18
15
|
MIME_REGEXP = /^\[(([0-9.]+) [A-Za-z._\-]+\/[A-Za-z._\-]+.*|PGP\/MIME .*)\]$/
|
|
19
16
|
URI_OR_MIME_REGEXP = Regexp.union(URI_REGEXP, MIME_REGEXP)
|
|
20
17
|
|
|
@@ -157,7 +154,7 @@ module Mournmail
|
|
|
157
154
|
find_file(@attached_file.path)
|
|
158
155
|
else
|
|
159
156
|
background do
|
|
160
|
-
system(*CONFIG[:
|
|
157
|
+
system(*CONFIG[:mournmail_file_open_command], @attached_file.path,
|
|
161
158
|
out: File::NULL, err: File::NULL)
|
|
162
159
|
end
|
|
163
160
|
end
|
|
@@ -179,8 +176,8 @@ module Mournmail
|
|
|
179
176
|
insert u.to_mailtext.sub(/\n\n\z/, "")
|
|
180
177
|
end_of_buffer
|
|
181
178
|
else
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
cmd = Mournmail.account_config[:link_open_command] || CONFIG[:mournmail_link_open_command]
|
|
180
|
+
system(*cmd, uri, out: File::NULL, err: File::NULL)
|
|
184
181
|
end
|
|
185
182
|
end
|
|
186
183
|
end
|
data/lib/mournmail/utils.rb
CHANGED
|
@@ -267,7 +267,12 @@ module Mournmail
|
|
|
267
267
|
FileUtils.mkdir_p(File.dirname(auth_path))
|
|
268
268
|
store = Google::APIClient::FileStore.new(auth_path)
|
|
269
269
|
storage = Google::APIClient::Storage.new(store)
|
|
270
|
-
|
|
270
|
+
begin
|
|
271
|
+
storage.authorize
|
|
272
|
+
rescue Signet::AuthorizationError
|
|
273
|
+
File.unlink(auth_path)
|
|
274
|
+
raise
|
|
275
|
+
end
|
|
271
276
|
if storage.authorization.nil?
|
|
272
277
|
conf = CONFIG[:mournmail_accounts][account]
|
|
273
278
|
path = File.expand_path(conf[:client_secret_path])
|
data/lib/mournmail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mournmail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '
|
|
4
|
+
version: '3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shugo Maeda
|
|
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
227
227
|
- !ruby/object:Gem::Version
|
|
228
228
|
version: '0'
|
|
229
229
|
requirements: []
|
|
230
|
-
rubygems_version:
|
|
230
|
+
rubygems_version: 4.1.0.dev
|
|
231
231
|
specification_version: 4
|
|
232
232
|
summary: A message user agent for Textbringer.
|
|
233
233
|
test_files: []
|