rubymta 0.0.16 → 0.0.17
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/rubymta/contact.rb +9 -1
- data/lib/rubymta/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51892b11fbf1a02e1f6e981c83f85e3cfe62e7d9
|
4
|
+
data.tar.gz: c3de0f435ac9b2e97c8fd6dc5de1a2f82ff8080f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f545ab6156a4026acfec46a67d2401ad56b5a689860a3043189d71975a984c3b70a2a8c581618fb74694be31bf8b3201724d1049a2feb179b0470480559dcde8
|
7
|
+
data.tar.gz: 3fc12c1ec8a51fc1f0629cf0def9c6800606a11790ee67b0575cc9b70483242d94e79c7369c8d7996e42ab4af22f6c404ececd4c88ca5b9846f9ae2d0d0429e4
|
data/lib/rubymta/contact.rb
CHANGED
@@ -54,13 +54,21 @@ class Contact < Hash
|
|
54
54
|
# Count the violation and reset the 'expires_at' time -- Also
|
55
55
|
# counts the times this IP has been locked out -- only count
|
56
56
|
# one violation and one lock per instantiation
|
57
|
+
#
|
58
|
+
# The UseIPTables feature requires the 'at' app ("apt install at")
|
57
59
|
if !inhibited?
|
58
60
|
self[:violations]+=1
|
59
61
|
@inhibit = true
|
60
62
|
if prohibited?
|
61
63
|
self[:locks] += 1
|
62
|
-
self[:expires_at] = Time.now + ProhibitedSeconds
|
64
|
+
self[:expires_at] = t = Time.now + ProhibitedSeconds
|
63
65
|
modify
|
66
|
+
if defined?(UseIPTables) && UseIPTables
|
67
|
+
puts insert = "iptables -I INPUT -s #{self[:remote_ip]} -j DROP"
|
68
|
+
puts drop = "echo \"iptables -D INPUT -s #{self[:remote_ip]} -j DROP\" | at #{t.strftime("%H:%M")} #{t.strftime("%Y-%m-%d")}"
|
69
|
+
`iptables -I INPUT -s #{self[:remote_ip]} -j DROP`
|
70
|
+
`echo "iptables -D INPUT -s #{self[:remote_ip]} -j DROP" | at #{t.strftime("%H:%M")} #{t.strftime("%Y-%m-%d")}`
|
71
|
+
end
|
64
72
|
raise Quit # force quit: some senders try to keep going
|
65
73
|
end
|
66
74
|
modify
|
data/lib/rubymta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubymta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael J. Welch, Ph.D.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: RubyMta is an experimental mail transport agent written in Ruby. See
|
14
14
|
the README.
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.5.
|
56
|
+
rubygems_version: 2.5.2
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: A Ruby Gem providing a complete Mail Transport Agent package.
|