osa 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -19
- data/lib/osa/clients/ms_graph_client.rb +3 -0
- data/lib/osa/scripts/scan_junk_folder.rb +14 -0
- data/lib/osa/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: c0fbdd1dceb350e48a1d593ec7590e5c1caba49136ae6c6a1afb3a41a86683d8
|
4
|
+
data.tar.gz: 962578a1b23e0879a5175f21a6c617812cec82e3f6577b58f401dc0cd78becc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aabca2784a303f54c43eda8ef7f1491438c65658184eebc6821574785057b2b3ced909787cd66dca29b8db38aa85fdf60959041884373eb84c6bbeb72204d99e
|
7
|
+
data.tar.gz: befb3a9c9ac8ca252c5e23c84bb7fdb709be6765e092d2315472baccfda59736949d4bfcb1fa6e78b3216e09d638798c344150b18af26147c7eddd2a2307dd73
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
osa (0.1.
|
4
|
+
osa (0.1.3)
|
5
5
|
activerecord (~> 6.0)
|
6
6
|
faraday (~> 1.1)
|
7
7
|
public_suffix (~> 4.0)
|
@@ -11,23 +11,25 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activemodel (6.0
|
15
|
-
activesupport (= 6.0
|
16
|
-
activerecord (6.0
|
17
|
-
activemodel (= 6.0
|
18
|
-
activesupport (= 6.0
|
19
|
-
activesupport (6.0
|
14
|
+
activemodel (6.1.0)
|
15
|
+
activesupport (= 6.1.0)
|
16
|
+
activerecord (6.1.0)
|
17
|
+
activemodel (= 6.1.0)
|
18
|
+
activesupport (= 6.1.0)
|
19
|
+
activesupport (6.1.0)
|
20
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
21
|
-
i18n (>=
|
22
|
-
minitest (
|
23
|
-
tzinfo (~>
|
24
|
-
zeitwerk (~> 2.
|
21
|
+
i18n (>= 1.6, < 2)
|
22
|
+
minitest (>= 5.1)
|
23
|
+
tzinfo (~> 2.0)
|
24
|
+
zeitwerk (~> 2.3)
|
25
25
|
ast (2.4.1)
|
26
26
|
concurrent-ruby (1.1.7)
|
27
|
-
faraday (1.
|
27
|
+
faraday (1.3.0)
|
28
|
+
faraday-net_http (~> 1.0)
|
28
29
|
multipart-post (>= 1.2, < 3)
|
29
30
|
ruby2_keywords
|
30
|
-
|
31
|
+
faraday-net_http (1.0.0)
|
32
|
+
i18n (1.8.6)
|
31
33
|
concurrent-ruby (~> 1.0)
|
32
34
|
minitest (5.14.2)
|
33
35
|
multipart-post (2.1.1)
|
@@ -57,22 +59,21 @@ GEM
|
|
57
59
|
ruby-progressbar (1.10.1)
|
58
60
|
ruby2_keywords (0.0.2)
|
59
61
|
sqlite3 (1.4.2)
|
60
|
-
thread_safe (0.3.6)
|
61
62
|
tty-color (0.6.0)
|
62
63
|
tty-cursor (0.7.1)
|
63
|
-
tty-prompt (0.
|
64
|
+
tty-prompt (0.23.0)
|
64
65
|
pastel (~> 0.8)
|
65
66
|
tty-reader (~> 0.8)
|
66
|
-
tty-reader (0.
|
67
|
+
tty-reader (0.9.0)
|
67
68
|
tty-cursor (~> 0.7)
|
68
69
|
tty-screen (~> 0.8)
|
69
70
|
wisper (~> 2.0)
|
70
71
|
tty-screen (0.8.1)
|
71
|
-
tzinfo (
|
72
|
-
|
72
|
+
tzinfo (2.0.4)
|
73
|
+
concurrent-ruby (~> 1.0)
|
73
74
|
unicode-display_width (1.7.0)
|
74
75
|
wisper (2.0.1)
|
75
|
-
zeitwerk (2.4.
|
76
|
+
zeitwerk (2.4.2)
|
76
77
|
|
77
78
|
PLATFORMS
|
78
79
|
ruby
|
@@ -3,6 +3,7 @@ require 'osa/util/constants'
|
|
3
3
|
require 'public_suffix'
|
4
4
|
require 'osa/util/db'
|
5
5
|
require 'osa/util/context'
|
6
|
+
require 'public_suffix'
|
6
7
|
|
7
8
|
context = OSA::Context.new
|
8
9
|
|
@@ -37,6 +38,19 @@ while continue
|
|
37
38
|
context.graph_client.forward_mail_as_attachment(mail['id'], context.config.spamcop_report_email)
|
38
39
|
puts "deleting spam from #{email_address}"
|
39
40
|
context.graph_client.delete_mail(mail['id'])
|
41
|
+
|
42
|
+
if flagged
|
43
|
+
domain = PublicSuffix.domain(email_address.split('@', 2)[1])
|
44
|
+
|
45
|
+
is_free_provider = OSA::EmailProvider.where(value: domain).exists?
|
46
|
+
if is_free_provider
|
47
|
+
puts "#{email_address} is using a free provider, blacklisting full address"
|
48
|
+
OSA::Blacklist.find_or_create_by(value: email_address).save!
|
49
|
+
else
|
50
|
+
puts "Adding #{domain} to blacklist"
|
51
|
+
OSA::Blacklist.find_or_create_by(value: domain).save!
|
52
|
+
end
|
53
|
+
end
|
40
54
|
end
|
41
55
|
mails = mails.next
|
42
56
|
end
|
data/lib/osa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moray Baruh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|