rubymta 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9eee9048f339e3729e46ca659a20b007e12fd31
4
- data.tar.gz: 49c064d5f9f642108a58733e6370992272235e3e
3
+ metadata.gz: 342f0caad82d98379a66f1b3a776211bf9469edd
4
+ data.tar.gz: 90406eb6b7165e27a40f841f3e424883d4390824
5
5
  SHA512:
6
- metadata.gz: 7dc5ab4ce63fbef730f57f44fbb5063a71d3c5040764f43d8cc5825a34112f4e98cff491a07625fb35040ccacc7ea0b6e5cdca96f23c2dee226718599da264a9
7
- data.tar.gz: 7525ee10f2723a3b24b0ef1848f72a83ffed99b9ca149f98d30dcc2ec38eddc919183e5778260ae2f3dee8971061b9af17e7a5f50ce51cb4a87697a775f5ec62
6
+ metadata.gz: 64bc2f2844106e9aa06089f2f3cdbc145702cbed7a60d155b0c5b287bc62f99a0db11997a2ae5aa81988d29ead7f741eb36409f2be496c6207b964c6a4ebf91d
7
+ data.tar.gz: 118905e30a717ed45d89da660c5a06ed5dea9c203339d3dfdf1d309eec16ddf3520cd1e182c94a0e136a986d6f1449d8b75d807c2526ae25a4ce6f3cef85ee9e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # v0.0.4
2
+
3
+ * Updated the gem to reflect changes in Ruby Sequel v4.40.0.
4
+
5
+
6
+ # v0.0.3
7
+
8
+ * Added a `contact_id` firld to the `parcels` table so that the parcels can be related back to the IP that sent them, irrespective of the domain names presented. The contact IP is an absolute quantity, and one of the first ones we get, so it forms the cornerstone of the data structure.
9
+
10
+
1
11
  # v0.0.2
2
12
 
3
13
  * Added code to make sure RubyMTA quits on the next command after a violations warning is given.
@@ -8,6 +18,7 @@
8
18
  * Fixed a bug in queue_runner where it coded a partial item of mail as 'local'. Now, if the @mail[:accepted] flag is not true, the mail destination in the packet is set to 'none' as it should be.
9
19
  * Made a change such that all packets coded as :delivery=>'none' also have the :delivery_at=>Time.now.
10
20
 
21
+
11
22
  # v0.0.1
12
23
 
13
24
  * Initial load. See the README.md for details.
@@ -2,7 +2,7 @@ class Contact < Hash
2
2
 
3
3
  def initialize(remote_ip)
4
4
  # Reset timed-out records
5
- S3DB[:contacts].where("expires_at<'#{Time.now.strftime("%Y-%m-%d %H:%M")}'").update(:violations=>0)
5
+ S3DB[:contacts].where(Sequel.lit("expires_at<'#{Time.now.strftime("%Y-%m-%d %H:%M")}'")).update(:violations=>0)
6
6
 
7
7
  # See if it's already there
8
8
  rs = S3DB[:contacts].where(:remote_ip=>remote_ip).first
@@ -64,7 +64,7 @@ class QueueRunner
64
64
  while true
65
65
  # sqlite3 has a bug: "<=" doesn't work with time, ex. "retry_at<='#{Time.now}'"
66
66
  # we have to add 1 second and use "<"; ex. "retry_at<'#{Time.now+1}'"
67
- parcels = S3DB[:parcels].where("(delivery<>'none') and (delivery_at is null) and ((retry_at is null) or (retry_at<'#{Time.now + 1}'))").all
67
+ parcels = S3DB[:parcels].where(Sequel.lit("(delivery<>'none') and (delivery_at is null) and ((retry_at is null) or (retry_at<'#{Time.now + 1}'))")).all
68
68
  return if parcels.empty?
69
69
 
70
70
  # aggregate the emails by destination domain
@@ -178,6 +178,7 @@ class Receiver
178
178
  @mail[:remote_port] = remote_port
179
179
  @mail[:remote_hostname] = remote_hostname
180
180
  @mail[:remote_ip] = remote_ip
181
+ @mail[:saved] = true # prevent saving until we have at least a MAIL FROM
181
182
  LOG.info(@mail[:mail_id]) {"New item of mail opened with id '#{@mail[:mail_id]}'"}
182
183
 
183
184
  # start the main receiving process here
@@ -198,7 +199,6 @@ class Receiver
198
199
  if (text.nil?) || @warning_given
199
200
  text = "QUIT"
200
201
  @contact.violation
201
- @mail[:saved] = true # prevent saving
202
202
  end
203
203
  # this handles an attempt to connect with HTTP
204
204
  if text.start_with?("GET")
@@ -246,7 +246,7 @@ class Receiver
246
246
  ensure
247
247
  # make sure the incoming email is saved, in case there was a receive error;
248
248
  # otherwise, it gets saved just before the "250 OK" in the DATA section
249
- if !@mail[:saved]
249
+ if @mail && !@mail[:saved]
250
250
  LOG.error(@mail[:mail_id]) {"#{@mail[:mail_id]} was not received completely. Saving the partial copy to queue."}
251
251
 
252
252
  # the email is faulty--save for reference
@@ -339,6 +339,7 @@ class Receiver
339
339
  def mail_from_base(value)
340
340
  @mail[:mailfrom] = from = {}
341
341
  @mail[:rcptto] = []
342
+ @mail[:saved] = false # enable saving
342
343
  from[:accepted] = false
343
344
  ok = psych_value(from, value)
344
345
 
@@ -48,6 +48,11 @@ if !UserName.nil?
48
48
  File::chown($app[:uinfo].uid, $app[:ginfo].gid, S3DBPath)
49
49
  end
50
50
 
51
+ # This changed as of Sequel v.4.40.0
52
+ # This is false by default, but was supposed to be
53
+ # true by default so we have to forcefully set it
54
+ Sequel.split_symbols = true
55
+
51
56
  # Open the sqlite3 database for rubymta use
52
57
  S3DB = Sequel.connect("sqlite://#{S3DBPath}")
53
58
  LOG.info("Database '#{S3DBPath}' opened")
@@ -1,5 +1,5 @@
1
1
  module Version
2
- VERSION = "0.0.3"
3
- MODIFIED = "2017-09-05"
2
+ VERSION = "0.0.4"
3
+ MODIFIED = "2017-09-16"
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.3
4
+ version: 0.0.4
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-09-05 00:00:00.000000000 Z
11
+ date: 2017-09-16 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.4.6
56
+ rubygems_version: 2.6.13
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: A Ruby Gem providing a complete Mail Transport Agent package.