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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21e90301e71f47d7688639e2274a3de5e48b6bfb
4
- data.tar.gz: 0ebd722efb5d5d729171802dbd25cdfca218500b
3
+ metadata.gz: 51892b11fbf1a02e1f6e981c83f85e3cfe62e7d9
4
+ data.tar.gz: c3de0f435ac9b2e97c8fd6dc5de1a2f82ff8080f
5
5
  SHA512:
6
- metadata.gz: bc03e6ed1b3c8e8303173fe480be8962ba0f244d673d32a49b565025c9f96a35d566d5132e72f8c8b26f21e76cb0d77c20b8c8f4a13a9eceaacff913c3b0a702
7
- data.tar.gz: 639f09f898661a3dffff2be7bffdb83f927df4e18f5e9402d5fdca79763b46af7ba7ef1cc91722d677793aacbc0ac483e1f9652637693a428710d0e75f8beaa8
6
+ metadata.gz: f545ab6156a4026acfec46a67d2401ad56b5a689860a3043189d71975a984c3b70a2a8c581618fb74694be31bf8b3201724d1049a2feb179b0470480559dcde8
7
+ data.tar.gz: 3fc12c1ec8a51fc1f0629cf0def9c6800606a11790ee67b0575cc9b70483242d94e79c7369c8d7996e42ab4af22f6c404ececd4c88ca5b9846f9ae2d0d0429e4
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Version
2
- VERSION = "0.0.16"
3
- MODIFIED = "2017-11-13"
2
+ VERSION = "0.0.17"
3
+ MODIFIED = "2017-11-30"
4
4
  end
5
5
 
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.16
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-13 00:00:00.000000000 Z
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.1
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.