mail-gpg 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/lib/mail/gpg.rb +8 -5
- data/lib/mail/gpg/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: b7e6ef944bc641fa51f189b379859528044939a7eeca16d44cdeab8f46fdbc0c
|
4
|
+
data.tar.gz: aaa67237e62a803b4d369f81a70d71511e55b175c4ba95714137d6a0aa649cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c5224711ba09fe1b59cfb6076fe4c8c09838e0915411411fe044b5b04d76949bb74eb81e8e9a0242c8996a5be6c380c43d2662942fe58714c1d838c71ecf756
|
7
|
+
data.tar.gz: 25e41d97a17fc966d4839f96b7c827432c1e7f60905d9675238633660efa5a930c4ff9028c91c84ab8db66f0884601fb0ff5fc8b760c194ceae37fab261f09e8
|
data/History.txt
CHANGED
data/lib/mail/gpg.rb
CHANGED
@@ -17,10 +17,13 @@ require 'mail/gpg/inline_signed_message'
|
|
17
17
|
|
18
18
|
module Mail
|
19
19
|
module Gpg
|
20
|
+
BEGIN_PGP_MESSAGE_MARKER = /^-----BEGIN PGP MESSAGE-----/
|
21
|
+
BEGIN_PGP_SIGNED_MESSAGE_MARKER = /^-----BEGIN PGP SIGNED MESSAGE-----/
|
22
|
+
|
20
23
|
# options are:
|
21
24
|
# :sign: sign message using the sender's private key
|
22
25
|
# :sign_as: sign using this key (give the corresponding email address or key fingerprint)
|
23
|
-
# :
|
26
|
+
# :password: passphrase for the signing key
|
24
27
|
# :keys: A hash mapping recipient email addresses to public keys or public
|
25
28
|
# key ids. Imports any keys given here that are not already part of the
|
26
29
|
# local keychain before sending the mail.
|
@@ -198,10 +201,10 @@ module Mail
|
|
198
201
|
# check if inline PGP (i.e. if any parts of the mail includes
|
199
202
|
# the PGP MESSAGE marker)
|
200
203
|
def self.encrypted_inline?(mail)
|
201
|
-
return true if mail.body.
|
204
|
+
return true if mail.body.to_s =~ BEGIN_PGP_MESSAGE_MARKER rescue nil
|
202
205
|
if mail.multipart?
|
203
206
|
mail.parts.each do |part|
|
204
|
-
return true if part.body.
|
207
|
+
return true if part.body.to_s =~ BEGIN_PGP_MESSAGE_MARKER rescue nil
|
205
208
|
return true if part.has_content_type? &&
|
206
209
|
/application\/(?:octet-stream|pgp-encrypted)/ =~ part.mime_type &&
|
207
210
|
/.*\.(?:pgp|gpg|asc)$/ =~ part.content_type_parameters[:name] &&
|
@@ -223,10 +226,10 @@ module Mail
|
|
223
226
|
# check if inline PGP (i.e. if any parts of the mail includes
|
224
227
|
# the PGP SIGNED marker)
|
225
228
|
def self.signed_inline?(mail)
|
226
|
-
return true if mail.body.to_s =~
|
229
|
+
return true if mail.body.to_s =~ BEGIN_PGP_SIGNED_MESSAGE_MARKER rescue nil
|
227
230
|
if mail.multipart?
|
228
231
|
mail.parts.each do |part|
|
229
|
-
return true if part.body.to_s =~
|
232
|
+
return true if part.body.to_s =~ BEGIN_PGP_SIGNED_MESSAGE_MARKER rescue nil
|
230
233
|
end
|
231
234
|
end
|
232
235
|
false
|
data/lib/mail/gpg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail-gpg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Kraemer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|