tuktuk 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/tuktuk/tuktuk.rb CHANGED
@@ -12,6 +12,7 @@ DEFAULTS = {
12
12
  :max_workers => 0,
13
13
  :read_timeout => 20,
14
14
  :open_timeout => 20,
15
+ :helo_domain => nil,
15
16
  :verify_ssl => true,
16
17
  :log_to => nil # $stdout,
17
18
  }
@@ -93,6 +94,7 @@ module Tuktuk
93
94
  raise "Invalid destination count: #{mail.destinations.count}" if mail.destinations.count != 1
94
95
 
95
96
  if to = mail.destinations.first and domain = get_domain(to)
97
+ domain = domain.downcase
96
98
  hash[domain] = [] if hash[domain].nil?
97
99
  hash[domain].push(mail)
98
100
  end
@@ -136,7 +138,7 @@ module Tuktuk
136
138
  end
137
139
 
138
140
  def lookup_and_deliver_many(by_domain)
139
- if config[:max_workers] && config[:max_workers] > 0
141
+ if config[:max_workers] && config[:max_workers] != 0
140
142
  lookup_and_deliver_many_threaded(by_domain)
141
143
  else
142
144
  lookup_and_deliver_many_sync(by_domain)
@@ -144,7 +146,8 @@ module Tuktuk
144
146
  end
145
147
 
146
148
  def lookup_and_deliver_many_threaded(by_domain)
147
- queue = WorkQueue.new(config[:max_workers])
149
+ count = config[:max_workers].is_a?(Integer) ? config[:max_workers] : nil
150
+ queue = WorkQueue.new(count)
148
151
  responses = []
149
152
 
150
153
  by_domain.each do |domain, mails|
@@ -157,7 +160,8 @@ module Tuktuk
157
160
  end # worker
158
161
  end
159
162
 
160
- queue.join
163
+ queue.join # wait for threads to finish
164
+ queue.kill # terminate queue
161
165
  responses
162
166
  end
163
167
 
@@ -230,6 +234,7 @@ module Tuktuk
230
234
  unless timeout_error
231
235
  begin
232
236
  resp = smtp.send_message(get_raw_mail(mail), get_from(mail), mail.to)
237
+ smtp.send(:getok, 'RSET') if server['hotmail'] # fix for '503 Sender already specified'
233
238
  rescue Net::SMTPError, EOFError, Timeout::Error => e # may be Net::SMTPFatalError (550 Mailbox not found)
234
239
  # logger.error e.inspect
235
240
  timeout_error = e if e.is_a?(Timeout::Error)
@@ -1,7 +1,7 @@
1
1
  module Tuktuk
2
2
  MAJOR = 0
3
3
  MINOR = 4
4
- PATCH = 4
4
+ PATCH = 5
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
metadata CHANGED
@@ -1,103 +1,111 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: tuktuk
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 5
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 5
10
+ version: 0.4.5
6
11
  platform: ruby
7
- authors:
8
- - Tomás Pollak
12
+ authors:
13
+ - "Tom\xC3\xA1s Pollak"
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-02-22 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-05-19 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: bundler
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 1.0.0
22
- type: :development
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 23
29
+ segments:
30
+ - 1
31
+ - 0
32
+ - 0
29
33
  version: 1.0.0
30
- - !ruby/object:Gem::Dependency
34
+ type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
31
37
  name: net-dns
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - '='
36
- - !ruby/object:Gem::Version
37
- version: 0.6.1
38
- type: :runtime
39
38
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
43
- - - '='
44
- - !ruby/object:Gem::Version
41
+ requirements:
42
+ - - "="
43
+ - !ruby/object:Gem::Version
44
+ hash: 5
45
+ segments:
46
+ - 0
47
+ - 6
48
+ - 1
45
49
  version: 0.6.1
46
- - !ruby/object:Gem::Dependency
47
- name: mail
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '2.3'
54
50
  type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: mail
55
54
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
55
+ requirement: &id003 !ruby/object:Gem::Requirement
57
56
  none: false
58
- requirements:
57
+ requirements:
59
58
  - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '2.3'
62
- - !ruby/object:Gem::Dependency
63
- name: dkim
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: 0.0.2
59
+ - !ruby/object:Gem::Version
60
+ hash: 5
61
+ segments:
62
+ - 2
63
+ - 3
64
+ version: "2.3"
70
65
  type: :runtime
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: dkim
71
69
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
73
71
  none: false
74
- requirements:
72
+ requirements:
75
73
  - - ~>
76
- - !ruby/object:Gem::Version
74
+ - !ruby/object:Gem::Version
75
+ hash: 27
76
+ segments:
77
+ - 0
78
+ - 0
79
+ - 2
77
80
  version: 0.0.2
78
- - !ruby/object:Gem::Dependency
79
- name: work_queue
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: 2.5.0
86
81
  type: :runtime
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: work_queue
87
85
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
86
+ requirement: &id005 !ruby/object:Gem::Requirement
89
87
  none: false
90
- requirements:
88
+ requirements:
91
89
  - - ~>
92
- - !ruby/object:Gem::Version
90
+ - !ruby/object:Gem::Version
91
+ hash: 27
92
+ segments:
93
+ - 2
94
+ - 5
95
+ - 0
93
96
  version: 2.5.0
97
+ type: :runtime
98
+ version_requirements: *id005
94
99
  description: Easy way of sending DKIM-signed emails from Ruby, no dependencies needed.
95
- email:
100
+ email:
96
101
  - tomas@forkhq.com
97
102
  executables: []
103
+
98
104
  extensions: []
105
+
99
106
  extra_rdoc_files: []
100
- files:
107
+
108
+ files:
101
109
  - .gitignore
102
110
  - Gemfile
103
111
  - README.md
@@ -111,26 +119,38 @@ files:
111
119
  - tuktuk.gemspec
112
120
  homepage: https://github.com/tomas/tuktuk
113
121
  licenses: []
122
+
114
123
  post_install_message:
115
124
  rdoc_options: []
116
- require_paths:
125
+
126
+ require_paths:
117
127
  - lib
118
- required_ruby_version: !ruby/object:Gem::Requirement
128
+ required_ruby_version: !ruby/object:Gem::Requirement
119
129
  none: false
120
- requirements:
121
- - - ! '>='
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
138
  none: false
126
- requirements:
127
- - - ! '>='
128
- - !ruby/object:Gem::Version
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ hash: 23
143
+ segments:
144
+ - 1
145
+ - 3
146
+ - 6
129
147
  version: 1.3.6
130
148
  requirements: []
149
+
131
150
  rubyforge_project: tuktuk
132
- rubygems_version: 1.8.23
151
+ rubygems_version: 1.8.15
133
152
  signing_key:
134
153
  specification_version: 3
135
154
  summary: SMTP client for Ruby with DKIM support.
136
155
  test_files: []
156
+