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 +4 -4
- data/lib/rubymta/item_of_mail.rb +1 -0
- data/lib/rubymta/receiver.rb +4 -5
- data/lib/rubymta/server.rb +1 -0
- data/lib/rubymta/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9eee9048f339e3729e46ca659a20b007e12fd31
|
4
|
+
data.tar.gz: 49c064d5f9f642108a58733e6370992272235e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc5ab4ce63fbef730f57f44fbb5063a71d3c5040764f43d8cc5825a34112f4e98cff491a07625fb35040ccacc7ea0b6e5cdca96f23c2dee226718599da264a9
|
7
|
+
data.tar.gz: 7525ee10f2723a3b24b0ef1848f72a83ffed99b9ca149f98d30dcc2ec38eddc919183e5778260ae2f3dee8971061b9af17e7a5f50ce51cb4a87697a775f5ec62
|
data/lib/rubymta/item_of_mail.rb
CHANGED
@@ -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]
|
data/lib/rubymta/receiver.rb
CHANGED
@@ -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]}"}
|
data/lib/rubymta/server.rb
CHANGED
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.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-
|
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.
|