rubymta 0.0.2 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db5391a0c0a63fc549ebe8c21db735b96dd901f5
4
- data.tar.gz: 48fbfaa4c0678490799c9d5b96dd54cfc40b7cad
3
+ metadata.gz: c9eee9048f339e3729e46ca659a20b007e12fd31
4
+ data.tar.gz: 49c064d5f9f642108a58733e6370992272235e3e
5
5
  SHA512:
6
- metadata.gz: 583963c19dd3465c318c62d0bd5b3576eb5cfb3413582806144d4845aece9b591b2f953b499146bb60ee14aa5dde9f1e00305914d719cffe9a6faac73a2f1760
7
- data.tar.gz: c9b5f25a6497ab2be2260588d647f8daca356a8097d5f87d7d26cf43d6252f7909571185b432e5710931dc12fc7d7512d81b1ac72b11c3e1e729f52234019898
6
+ metadata.gz: 7dc5ab4ce63fbef730f57f44fbb5063a71d3c5040764f43d8cc5825a34112f4e98cff491a07625fb35040ccacc7ea0b6e5cdca96f23c2dee226718599da264a9
7
+ data.tar.gz: 7525ee10f2723a3b24b0ef1848f72a83ffed99b9ca149f98d30dcc2ec38eddc919183e5778260ae2f3dee8971061b9af17e7a5f50ce51cb4a87697a775f5ec62
@@ -59,6 +59,7 @@ class ItemOfMail < Hash
59
59
  # make entries into the database for tracking the deliveries
60
60
  parcel = {}
61
61
  parcel[:id] = nil
62
+ parcel[:contact_id] = self[:contact_id]
62
63
  parcel[:mail_id] = self[:mail_id]
63
64
  parcel[:from_url] = self[:mailfrom][:url]
64
65
  parcel[:to_url] = rcptto[:url]
@@ -170,12 +170,15 @@ class Receiver
170
170
 
171
171
  def receive(local_port, local_hostname, remote_port, remote_hostname, remote_ip)
172
172
  # Start a hash to collect the information gathered from the receive process
173
+ @contact = Contact::new(remote_ip)
173
174
  @mail = ItemOfMail::new
175
+ @mail[:contact_id] = @contact[:id]
174
176
  @mail[:local_port] = local_port
175
177
  @mail[:local_hostname] = local_hostname
176
178
  @mail[:remote_port] = remote_port
177
179
  @mail[:remote_hostname] = remote_hostname
178
180
  @mail[:remote_ip] = remote_ip
181
+ LOG.info(@mail[:mail_id]) {"New item of mail opened with id '#{@mail[:mail_id]}'"}
179
182
 
180
183
  # start the main receiving process here
181
184
  @done = false
@@ -195,6 +198,7 @@ class Receiver
195
198
  if (text.nil?) || @warning_given
196
199
  text = "QUIT"
197
200
  @contact.violation
201
+ @mail[:saved] = true # prevent saving
198
202
  end
199
203
  # this handles an attempt to connect with HTTP
200
204
  if text.start_with?("GET")
@@ -271,11 +275,6 @@ class Receiver
271
275
  #-------------------------------------------------------#
272
276
 
273
277
  def connect_base
274
- @contact = Contact.new(@mail[:remote_ip])
275
- raise StandardError.new("contact.new failed; see log") if @contact.nil?
276
-
277
- LOG.info(@mail[:mail_id]) {"New item of mail opened with id '#{@mail[:mail_id]}'"}
278
-
279
278
  if @contact.prohibited?
280
279
  # after the first denied message, we just slam the channel shut: no more nice guy
281
280
  LOG.warn(@mail[:mail_id]) {"Slammed connection shut. No more nice guy with #{@mail[:remote_ip]}"}
@@ -73,6 +73,7 @@ end
73
73
  # queue runner will read this queue and attempt to deliver the emails.
74
74
  S3DB::create_table?(:parcels) do
75
75
  primary_key(:id)
76
+ integer(:contact_id)
76
77
  string(:mail_id)
77
78
  string(:from_url)
78
79
  string(:to_url)
@@ -1,5 +1,5 @@
1
1
  module Version
2
- VERSION = "0.0.2"
3
- MODIFIED = "2017-08-14"
2
+ VERSION = "0.0.3"
3
+ MODIFIED = "2017-09-05"
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.2
4
+ version: 0.0.3
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-08-14 00:00:00.000000000 Z
11
+ date: 2017-09-05 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.