drillmail 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: a10a42e0e82247e18e345f722748855d5ed8f495
4
- data.tar.gz: 3df6e8f94996c693598c23c95b180c4ce639f97f
3
+ metadata.gz: 0f3706a86ade7c69f2fd52744c6f1247d23f9724
4
+ data.tar.gz: f37f7ad025f4ff57e6c1a872f0ac7ae323d19314
5
5
  SHA512:
6
- metadata.gz: a00e6d41e9c7cdc8a8a167d43bfa47dffdcd60397a7c99bc0c8f6c0b59d400e409c336d6fdff9c80be4c636653f2a850ec67837f2f9db114b4bd52a369eb5ad3
7
- data.tar.gz: ad8858a1ef6a23f3fda78afd60732f02ddd7eb8355cb7768278e927020e6a1afd4502c4c8e93764db8ec93fe486f19e4db7767cb40889588874ae49c2decb21a
6
+ metadata.gz: 69a342389eb3a6098494653a6a411a11212ab85cee4f4adff90251295a7bc80ba963b0ec592a379ddc4fb73c717cc2cf9a7b67ad1e757ab2fcc896083e2e9972
7
+ data.tar.gz: 3a1d70f1e89f63006bef3a0008752b73335eb8074aabbc1404448e447bd8495718b228ba622c7597aec861d83f3c1b76ac7f4ce61887c6c14873e9d39c3e55cc
data/drillmail.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'drillmail'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.date = '2016-11-30'
5
5
  s.summary = "A Ruby mail server and library"
6
6
  s.description = "A Ruby implementation of the SMTP protocol that can be run as a deamon"
@@ -1,4 +1,5 @@
1
1
  require 'mail'
2
+ require 'securerandom'
2
3
 
3
4
  DataCommand = Struct.new(:session, :body) do
4
5
  def call
@@ -11,8 +12,12 @@ DataCommand = Struct.new(:session, :body) do
11
12
  end
12
13
 
13
14
  mail = Mail.new(session.message.join)
14
- puts "writing to #{mail.to.last}/#{mail.subject}.eml"
15
- File.open("./#{mail.to.last}/#{mail.subject}.eml", 'w') do |f|
15
+
16
+ puts "writing to #{mail.to.last}/#{mail.message_id}.eml"
17
+ # this could be dangerous as fake messages could flood in
18
+ # as we would just be committing them all to disk. Should do this
19
+ # async?
20
+ File.open("./#{mail.to.last}/#{mail.message_id}.eml", 'w') do |f|
16
21
  f.write(mail)
17
22
  end
18
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drillmail
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
  - Jasper Lyons