tuktuk 0.5.0 → 0.5.1
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.
- data/README.md +14 -1
- data/lib/tuktuk/bounce.rb +5 -1
- data/lib/tuktuk/cache.rb +4 -0
- data/lib/tuktuk/dns.rb +4 -0
- data/lib/tuktuk/package.rb +4 -0
- data/lib/tuktuk/tuktuk.rb +2 -0
- data/lib/tuktuk/version.rb +1 -1
- data/spec/deliver_spec.rb +6 -6
- metadata +2 -2
data/README.md
CHANGED
@@ -9,6 +9,9 @@ response status codes -- like bounces, 5xx -- within your application.
|
|
9
9
|
|
10
10
|
Plus, it supports DKIM out of the box.
|
11
11
|
|
12
|
+
Delivering mail
|
13
|
+
---------------
|
14
|
+
|
12
15
|
``` ruby
|
13
16
|
require 'tuktuk'
|
14
17
|
|
@@ -36,7 +39,14 @@ else
|
|
36
39
|
end
|
37
40
|
```
|
38
41
|
|
39
|
-
|
42
|
+
Delivering multiple
|
43
|
+
-------------------
|
44
|
+
|
45
|
+
With Tuktuk, you can also deliver multiple messages at once. Depending on the `max_workers` config parameter, Tuktuk will either connect sequentially to the target domain's MX servers, or do it in parallel by spawning threads.
|
46
|
+
|
47
|
+
Tuktuk will try to send all emails targeted for a specific domain on the same SMTP session. If a MX server is not responding -- or times out in the middle --, Tuktuk will try to deliver the remaining messages to next MX server, and so on.
|
48
|
+
|
49
|
+
To #deliver_many, you need to pass an array of messages, and you'll receive an array of [response, email] elements, just as above.
|
40
50
|
|
41
51
|
``` ruby
|
42
52
|
messages = [ { ... }, { ... }, { ... }, { ... } ] # array of messages
|
@@ -54,6 +64,9 @@ result.each do |response, email|
|
|
54
64
|
end
|
55
65
|
```
|
56
66
|
|
67
|
+
Options & DKIM
|
68
|
+
--------------
|
69
|
+
|
57
70
|
Now, if you want to enable DKIM (and you should):
|
58
71
|
|
59
72
|
``` ruby
|
data/lib/tuktuk/bounce.rb
CHANGED
data/lib/tuktuk/cache.rb
CHANGED
data/lib/tuktuk/dns.rb
CHANGED
data/lib/tuktuk/package.rb
CHANGED
data/lib/tuktuk/tuktuk.rb
CHANGED
data/lib/tuktuk/version.rb
CHANGED
data/spec/deliver_spec.rb
CHANGED
@@ -69,10 +69,10 @@ describe 'deliver many' do
|
|
69
69
|
@emails = [email, email, email]
|
70
70
|
|
71
71
|
@success = mock('Net::SMTP::Response')
|
72
|
-
@soft_email_bounce
|
73
|
-
@hard_email_bounce
|
74
|
-
@soft_server_bounce = SoftBounce.new('Be back in a sec')
|
75
|
-
@hard_server_bounce = HardBounce.new('No MX records found.')
|
72
|
+
@soft_email_bounce = Tuktuk::SoftBounce.new('503 Sender already specified')
|
73
|
+
@hard_email_bounce = Tuktuk::HardBounce.new('505 Mailbox not found')
|
74
|
+
@soft_server_bounce = Tuktuk::SoftBounce.new('Be back in a sec')
|
75
|
+
@hard_server_bounce = Tuktuk::HardBounce.new('No MX records found.')
|
76
76
|
end
|
77
77
|
|
78
78
|
describe 'when domain exists' do
|
@@ -185,8 +185,8 @@ describe 'deliver many' do
|
|
185
185
|
it 'should not mark first email as bounced' do
|
186
186
|
Tuktuk.should_receive(:send_many_now).and_return([@first], [], [])
|
187
187
|
responses = Tuktuk.send(:lookup_and_deliver_by_domain, 'domain.com', @emails)
|
188
|
-
responses[1][0].should be_a(Bounce) if responses[1]
|
189
|
-
responses[0][0].should_not be_a(Bounce)
|
188
|
+
responses[1][0].should be_a(Tuktuk::Bounce) if responses[1]
|
189
|
+
responses[0][0].should_not be_a(Tuktuk::Bounce)
|
190
190
|
end
|
191
191
|
|
192
192
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tuktuk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|