sup 0.15.2 → 0.15.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.
- data/CONTRIBUTORS +11 -10
- data/History.txt +4 -0
- data/ReleaseNotes +4 -0
- data/lib/sup/account.rb +10 -42
- data/lib/sup/crypto.rb +4 -3
- data/lib/sup/mbox.rb +1 -1
- data/lib/sup/message.rb +13 -4
- data/lib/sup/version.rb +1 -1
- data/lib/sup.rb +0 -1
- metadata +4 -4
data/CONTRIBUTORS
CHANGED
@@ -18,8 +18,8 @@ Clint Byrum <clint at the ubuntu dot coms>
|
|
18
18
|
Marcus Williams <marcus-sup at the bar-coded dot nets>
|
19
19
|
Lionel Ott <white.magic at the gmx dot des>
|
20
20
|
Gaudenz Steinlin <gaudenz at the soziologie dot chs>
|
21
|
-
Ingmar Vanhassel <ingmar at the exherbo dot orgs>
|
22
21
|
Mark Alexander <marka at the pobox dot coms>
|
22
|
+
Ingmar Vanhassel <ingmar at the exherbo dot orgs>
|
23
23
|
Edward Z. Yang <ezyang at the mit dot edus>
|
24
24
|
Matthieu Rakotojaona <matthieu.rakotojaona at the gmail dot coms>
|
25
25
|
Christopher Warrington <chrisw at the rice dot edus>
|
@@ -33,8 +33,8 @@ Michael Hamann <michael at the content-space dot des>
|
|
33
33
|
Jonathan Lassoff <jof at the thejof dot coms>
|
34
34
|
William Erik Baxter <web at the superscript dot coms>
|
35
35
|
Grant Hollingworth <grant at the antiflux dot orgs>
|
36
|
-
Adeodato Simó <dato at the net.com.org dot ess>
|
37
36
|
Markus Klinik <markus.klinik at the gmx dot des>
|
37
|
+
Adeodato Simó <dato at the net.com.org dot ess>
|
38
38
|
Ico Doornekamp <ico at the pruts dot nls>
|
39
39
|
Daniel Schoepe <daniel.schoepe at the googlemail dot coms>
|
40
40
|
James Taylor <james at the jamestaylor dot orgs>
|
@@ -44,30 +44,31 @@ Steve Goldman <sgoldman at the tower-research dot coms>
|
|
44
44
|
Peter Harkins <ph at the malaprop dot orgs>
|
45
45
|
Decklin Foster <decklin at the red-bean dot coms>
|
46
46
|
Cameron Matheson <cam+sup at the cammunism dot orgs>
|
47
|
-
Alex Vandiver <alex at the chmrr dot nets>
|
48
47
|
Carl Worth <cworth at the cworth dot orgs>
|
48
|
+
Alex Vandiver <alex at the chmrr dot nets>
|
49
49
|
Andrew Pimlott <andrew at the pimlott dot nets>
|
50
50
|
Jeff Balogh <its.jeff.balogh at the gmail dot coms>
|
51
51
|
Matías Aguirre <matiasaguirre at the gmail dot coms>
|
52
52
|
Kornilios Kourtis <kkourt at the cslab.ece.ntua dot grs>
|
53
|
-
|
53
|
+
Lars Fischer <fischer at the wiwi.uni-siegen dot des>
|
54
54
|
Giorgio Lando <patroclo7 at the gmail dot coms>
|
55
|
+
Kevin Riggle <kevinr at the free-dissociation dot coms>
|
55
56
|
Benoît PIERRE <benoit.pierre at the gmail dot coms>
|
56
|
-
Steven Lawrance <stl at the koffein dot nets>
|
57
57
|
Alvaro Herrera <alvherre at the alvh.no-ip dot orgs>
|
58
|
+
Steven Lawrance <stl at the koffein dot nets>
|
58
59
|
Jonah <Jonah at the GoodCoffee dot cas>
|
59
60
|
ian <itaylor at the uark dot edus>
|
60
|
-
Gregor Hoffleit <gregor at the sam.mediasupervision dot des>
|
61
|
-
0xACE <0xACE at the users.noreply.github dot coms>
|
62
|
-
Adam Lloyd <adam at the alloy-d dot nets>
|
63
61
|
Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
|
64
62
|
MichaelRevell <mikearevell at the gmail dot coms>
|
63
|
+
Adam Lloyd <adam at the alloy-d dot nets>
|
64
|
+
Gregor Hoffleit <gregor at the sam.mediasupervision dot des>
|
65
65
|
Per Andersson <avtobiff at the gmail dot coms>
|
66
|
+
0xACE <0xACE at the users.noreply.github dot coms>
|
66
67
|
Steven Walter <swalter at the monarch.(none)>
|
67
|
-
Jon M. Dugan <jdugan at the es dot nets>
|
68
68
|
Matthias Vallentin <vallentin at the icir dot orgs>
|
69
|
-
|
69
|
+
Jon M. Dugan <jdugan at the es dot nets>
|
70
70
|
Stefan Lundström <lundst at the snabb.(none)>
|
71
71
|
akojo <atte.kojo at the gmail dot coms>
|
72
|
+
Horacio Sanson <horacio at the skillupjapan.co dot jps>
|
72
73
|
Johannes Larsen <johs.a.larsen at the gmail dot coms>
|
73
74
|
Kirill Smelkov <kirr at the landau.phys.spbu dot rus>
|
data/History.txt
CHANGED
data/ReleaseNotes
CHANGED
data/lib/sup/account.rb
CHANGED
@@ -31,8 +31,6 @@ class AccountManager
|
|
31
31
|
|
32
32
|
def initialize accounts
|
33
33
|
@email_map = {}
|
34
|
-
@hidden_email_map = {}
|
35
|
-
@email_map_dirty = false
|
36
34
|
@accounts = {}
|
37
35
|
@regexen = {}
|
38
36
|
@default_account = nil
|
@@ -42,7 +40,7 @@ class AccountManager
|
|
42
40
|
end
|
43
41
|
|
44
42
|
def user_accounts; @accounts.keys; end
|
45
|
-
def user_emails
|
43
|
+
def user_emails; @email_map.keys.select { |e| String === e }; end
|
46
44
|
|
47
45
|
## must be called first with the default account. fills in missing
|
48
46
|
## values from the default account.
|
@@ -52,9 +50,7 @@ class AccountManager
|
|
52
50
|
[:name, :sendmail, :signature, :gpgkey].each { |k| hash[k] ||= @default_account.send(k) }
|
53
51
|
end
|
54
52
|
hash[:alternates] ||= []
|
55
|
-
hash[:hidden_alternates] ||= []
|
56
53
|
fail "alternative emails are not an array: #{hash[:alternates]}" unless hash[:alternates].kind_of? Array
|
57
|
-
fail "hidden alternative emails are not an array: #{hash[:hidden_alternates]}" unless hash[:hidden_alternates].kind_of? Array
|
58
54
|
|
59
55
|
[:name, :signature].each { |x| hash[x] ? hash[x].fix_encoding! : nil }
|
60
56
|
|
@@ -67,11 +63,8 @@ class AccountManager
|
|
67
63
|
end
|
68
64
|
|
69
65
|
([hash[:email]] + hash[:alternates]).each do |email|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
hash[:hidden_alternates].each do |email|
|
74
|
-
add_email_to_map(:hidden, email, a)
|
66
|
+
next if @email_map.member? email
|
67
|
+
@email_map[email] = a
|
75
68
|
end
|
76
69
|
|
77
70
|
hash[:regexen].each do |re|
|
@@ -79,44 +72,19 @@ class AccountManager
|
|
79
72
|
end if hash[:regexen]
|
80
73
|
end
|
81
74
|
|
82
|
-
def is_account? p;
|
75
|
+
def is_account? p; is_account_email? p.email end
|
83
76
|
def is_account_email? email; !account_for(email).nil? end
|
84
|
-
|
85
77
|
def account_for email
|
86
|
-
a = email_map[email]
|
87
|
-
|
78
|
+
if(a = @email_map[email])
|
79
|
+
a
|
80
|
+
else
|
81
|
+
@regexen.argfind { |re, a| re =~ email && a }
|
82
|
+
end
|
88
83
|
end
|
89
|
-
|
90
84
|
def full_address_for email
|
91
85
|
a = account_for email
|
92
86
|
Person.full_address a.name, email
|
93
87
|
end
|
94
|
-
|
95
|
-
private
|
96
|
-
|
97
|
-
def add_email_to_map(type, email, acc)
|
98
|
-
type = :shown if type != :hidden
|
99
|
-
m = email_map(type)
|
100
|
-
unless m.member? email
|
101
|
-
m[email] = acc
|
102
|
-
@email_map_dirty = true
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
def email_map(type = nil)
|
107
|
-
case type
|
108
|
-
when :shown, :public then @email_map
|
109
|
-
when :hidden then @hidden_email_map
|
110
|
-
else
|
111
|
-
if @email_map_dirty
|
112
|
-
@email_map_all = @hidden_email_map.merge(@email_map)
|
113
|
-
if @email_map_all.count != @email_map.count + @hidden_email_map.count
|
114
|
-
@hidden_email_map.reject! { |m| @email_map.member? m }
|
115
|
-
end
|
116
|
-
end
|
117
|
-
@email_map_all ||= {}
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end # class AccountManager
|
88
|
+
end
|
121
89
|
|
122
90
|
end
|
data/lib/sup/crypto.rb
CHANGED
@@ -128,7 +128,6 @@ EOS
|
|
128
128
|
gpg_opts.merge!(gen_sign_user_opts(from))
|
129
129
|
gpg_opts = HookManager.run("gpg-options",
|
130
130
|
{:operation => "sign", :options => gpg_opts}) || gpg_opts
|
131
|
-
|
132
131
|
begin
|
133
132
|
if GPGME.respond_to?('detach_sign')
|
134
133
|
sig = GPGME.detach_sign(format_payload(payload), gpg_opts)
|
@@ -443,16 +442,18 @@ private
|
|
443
442
|
# if gpgkey set for this account, then use that
|
444
443
|
# elsif only one account, then leave blank so gpg default will be user
|
445
444
|
# else set --local-user from_email_address
|
445
|
+
# NOTE: multiple signers doesn't seem to work with gpgme (2.0.2, 1.0.8)
|
446
|
+
#
|
446
447
|
def gen_sign_user_opts from
|
447
448
|
account = AccountManager.account_for from
|
448
449
|
account ||= AccountManager.default_account
|
449
450
|
if !account.gpgkey.nil?
|
450
|
-
opts = {:
|
451
|
+
opts = {:signer => account.gpgkey}
|
451
452
|
elsif AccountManager.user_emails.length == 1
|
452
453
|
# only one account
|
453
454
|
opts = {}
|
454
455
|
else
|
455
|
-
opts = {:
|
456
|
+
opts = {:signer => from}
|
456
457
|
end
|
457
458
|
opts
|
458
459
|
end
|
data/lib/sup/mbox.rb
CHANGED
@@ -161,7 +161,7 @@ class MBox < Source
|
|
161
161
|
## TODO optimize this by iterating over allterms list backwards or
|
162
162
|
## storing source_info negated
|
163
163
|
def last_indexed_message
|
164
|
-
benchmark(:mbox_read_index) {
|
164
|
+
benchmark(:mbox_read_index) { Index.instance.enum_for(:each_source_info, self.id).map(&:to_i).max }
|
165
165
|
end
|
166
166
|
|
167
167
|
## offset of first new message or nil
|
data/lib/sup/message.rb
CHANGED
@@ -263,9 +263,9 @@ class Message
|
|
263
263
|
message_to_chunks rmsg
|
264
264
|
rescue SourceError, SocketError, RMail::EncodingUnsupportedError => e
|
265
265
|
warn "problem reading message #{id}"
|
266
|
-
[Chunk::Text.new(error_message.split("\n"))]
|
267
|
-
|
268
266
|
debug "could not load message: #{location.inspect}, exception: #{e.inspect}"
|
267
|
+
|
268
|
+
[Chunk::Text.new(error_message.split("\n"))]
|
269
269
|
end
|
270
270
|
end
|
271
271
|
|
@@ -497,13 +497,21 @@ private
|
|
497
497
|
## they have no MIME multipart and just set the body content type to
|
498
498
|
## application/pgp. this handles that.
|
499
499
|
##
|
500
|
-
## TODO: unduplicate code between here and
|
500
|
+
## TODO 1: unduplicate code between here and
|
501
|
+
## multipart_encrypted_to_chunks
|
502
|
+
## TODO 2: this only tries to decrypt. it cannot handle inline PGP
|
501
503
|
notice, sig, decryptedm = CryptoManager.decrypt m.body
|
502
504
|
if decryptedm # managed to decrypt
|
503
505
|
children = message_to_chunks decryptedm, true
|
504
506
|
[notice, sig].compact + children
|
505
507
|
else
|
506
|
-
|
508
|
+
## try inline pgp signed
|
509
|
+
chunks = inline_gpg_to_chunks m.body, $encoding, (m.charset || $encoding)
|
510
|
+
if chunks
|
511
|
+
chunks
|
512
|
+
else
|
513
|
+
[notice]
|
514
|
+
end
|
507
515
|
end
|
508
516
|
else
|
509
517
|
filename =
|
@@ -579,6 +587,7 @@ private
|
|
579
587
|
# -----END PGP SIGNED MESSAGE-----
|
580
588
|
#
|
581
589
|
# In some cases, END PGP SIGNED MESSAGE doesn't appear
|
590
|
+
# (and may leave strange -----BEGIN PGP SIGNATURE----- ?)
|
582
591
|
gpg = lines.between(GPG_SIGNED_START, GPG_SIGNED_END)
|
583
592
|
# between does not check if GPG_END actually exists
|
584
593
|
# Reference: http://permalink.gmane.org/gmane.mail.sup.devel/641
|
data/lib/sup/version.rb
CHANGED
data/lib/sup.rb
CHANGED
@@ -357,7 +357,6 @@ EOM
|
|
357
357
|
:name => name.dup.fix_encoding!,
|
358
358
|
:email => email.dup.fix_encoding!,
|
359
359
|
:alternates => [],
|
360
|
-
:hidden_alternates => [],
|
361
360
|
:sendmail => "/usr/sbin/sendmail -oem -ti",
|
362
361
|
:signature => File.join(ENV["HOME"], ".signature"),
|
363
362
|
:gpgkey => ""
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 15
|
9
|
-
-
|
10
|
-
hash: -
|
9
|
+
- 3
|
10
|
+
hash: -2405845392112023889
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- William Morgan
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date:
|
20
|
+
date: 2014-01-27 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: xapian-ruby
|