post_office 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/generic_server.rb +9 -1
- data/lib/smtp_server.rb +2 -1
- data/pkg/post_office-0.3.0.gem +0 -0
- data/post_office.gemspec +8 -4
- metadata +6 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/lib/generic_server.rb
CHANGED
@@ -26,7 +26,14 @@ class GenericServer
|
|
26
26
|
@port = options[:port]
|
27
27
|
server = TCPServer.open(@port)
|
28
28
|
$log.info "#{self.class.to_s} listening on port #{@port}"
|
29
|
-
|
29
|
+
|
30
|
+
# Try to increase the buffer to give us some more time to parse incoming data
|
31
|
+
begin
|
32
|
+
server.setsockopt(Socket::SOL_SOCKET, Socket::SO_RCVBUF, 1024 * 1024)
|
33
|
+
rescue
|
34
|
+
# then try it using our available buffer
|
35
|
+
end
|
36
|
+
|
30
37
|
# Accept connections until infinity and beyond
|
31
38
|
loop do
|
32
39
|
Thread.start(server.accept) do |client|
|
@@ -45,6 +52,7 @@ class GenericServer
|
|
45
52
|
$log.debug "#{client.object_id}:#{@port} < #{input}"
|
46
53
|
|
47
54
|
process(client, command, input)
|
55
|
+
|
48
56
|
end until client.closed?
|
49
57
|
$log.info "#{self.class.to_s} closed connection #{client.object_id} with #{client_addr.inspect}"
|
50
58
|
rescue => detail
|
data/lib/smtp_server.rb
CHANGED
@@ -65,6 +65,7 @@ class SMTPServer < GenericServer
|
|
65
65
|
# Markes client sending data
|
66
66
|
def data(client)
|
67
67
|
set_client_data(client, :sending_data, true)
|
68
|
+
set_client_data(client, :data, "")
|
68
69
|
respond(client, 354)
|
69
70
|
end
|
70
71
|
|
@@ -86,7 +87,7 @@ class SMTPServer < GenericServer
|
|
86
87
|
respond(client, 250)
|
87
88
|
$log.info "Received mail from #{get_client_data(client, :from).to_s} with recipient #{get_client_data(client, :to).to_s}"
|
88
89
|
else
|
89
|
-
|
90
|
+
self.client_data[client.object_id][:data] << full_data
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
Binary file
|
data/post_office.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{post_office}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rene van Lieshout"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-08-16}
|
13
13
|
s.description = %q{A mock SMTP/POP3 server to aid in the development of applications with mail functionality.}
|
14
14
|
s.email = %q{rene@bluerail.nl}
|
15
15
|
s.executables = ["post_office", "post_officed"]
|
@@ -25,15 +25,19 @@ Gem::Specification.new do |s|
|
|
25
25
|
"lib/generic_server.rb",
|
26
26
|
"lib/pop_server.rb",
|
27
27
|
"lib/smtp_server.rb",
|
28
|
+
"lib/startup_item.rb",
|
28
29
|
"lib/store.rb",
|
29
30
|
"pkg/post_office-0.1.0.gem",
|
30
31
|
"pkg/post_office-0.2.0.gem",
|
31
32
|
"pkg/post_office-0.2.1.gem",
|
32
|
-
"post_office.
|
33
|
+
"pkg/post_office-0.3.0.gem",
|
34
|
+
"post_office.gemspec",
|
35
|
+
"startup_item/PostOffice/PostOffice",
|
36
|
+
"startup_item/PostOffice/StartupParameters.plist"
|
33
37
|
]
|
34
38
|
s.homepage = %q{http://github.com/bluerail/post_office}
|
35
39
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = %q{1.5.
|
40
|
+
s.rubygems_version = %q{1.5.3}
|
37
41
|
s.summary = %q{PostOffice mock SMTP/POP3 server}
|
38
42
|
|
39
43
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: post_office
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rene van Lieshout
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-16 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- pkg/post_office-0.1.0.gem
|
43
43
|
- pkg/post_office-0.2.0.gem
|
44
44
|
- pkg/post_office-0.2.1.gem
|
45
|
+
- pkg/post_office-0.3.0.gem
|
45
46
|
- post_office.gemspec
|
46
47
|
- startup_item/PostOffice/PostOffice
|
47
48
|
- startup_item/PostOffice/StartupParameters.plist
|
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
requirements: []
|
76
77
|
|
77
78
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.5.
|
79
|
+
rubygems_version: 1.5.3
|
79
80
|
signing_key:
|
80
81
|
specification_version: 3
|
81
82
|
summary: PostOffice mock SMTP/POP3 server
|