gmailer 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGES +3 -0
  2. data/gmailer.gempsec +1 -1
  3. data/gmailer.rb +11 -9
  4. metadata +2 -2
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.2.0 - 20-Nov-2007
2
+ - fix connection problem with some accounts again
3
+
1
4
  == 0.1.9 - 7-Nov-2007
2
5
  - fix connection problem with some accounts
3
6
  - fix newer UI to old UI conversion
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = "gmailer"
5
- gem.version = "0.1.9"
5
+ gem.version = "0.2.0"
6
6
  gem.author = "Park Heesob"
7
7
  gem.email = "phasis_AT_gmail.com"
8
8
  gem.homepage = "http://rubyforge.org/projects/gmailutils"
data/gmailer.rb CHANGED
@@ -52,7 +52,7 @@ GM_ACT_DELSPAM = 20 # delete spam, forever
52
52
  GM_ACT_DELTRASH = 21 # delete trash message, forever
53
53
 
54
54
  module GMailer
55
- VERSION = "0.1.9"
55
+ VERSION = "0.2.0"
56
56
  attr_accessor :connection
57
57
 
58
58
  # the main class.
@@ -187,33 +187,35 @@ module GMailer
187
187
  result = ''
188
188
  cookies += ';'+ __cookies(response['set-cookie'])
189
189
  response = nil
190
- np.set_debug_output($stdout) if DEBUG
190
+ np.set_debug_output($stdout) if DEBUG
191
191
  np.start { |http|
192
192
  response = http.get(url, {'Cookie' => cookies,'User-agent'=> GM_USER_AGENT} )
193
193
  result = response.body
194
194
  }
195
195
  end
196
196
 
197
- if response["Location"]!=nil
197
+ if response["Location"]!=nil
198
198
  arr = URI::split(response["Location"])
199
199
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
200
200
  np.use_ssl = true
201
201
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
202
202
  result = ''
203
+ cookies = __cookies(response['set-cookie'])
203
204
  response = nil
204
205
  np.set_debug_output($stdout) if DEBUG
205
206
  np.start { |http|
206
207
  response = http.get("http://"+arr[2]+arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
207
208
  result = response.body
208
- }
209
+ }
209
210
  end
210
-
211
- if arr[2]!="mail.google.com" && response["Location"]!=nil
211
+
212
+ if response["Location"]!=nil && result.include?("Moved Temporarily")
212
213
  arr = URI::split(response["Location"])
213
214
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
214
215
  np.use_ssl = true
215
216
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
216
217
  result = ''
218
+ cookies = __cookies(response['set-cookie'])
217
219
  response = nil
218
220
  np.set_debug_output($stdout) if DEBUG
219
221
  np.start { |http|
@@ -295,7 +297,7 @@ module GMailer
295
297
  packets = {}
296
298
  matches.each do |x|
297
299
  x = unescapeHTML(x)
298
- tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{'))
300
+ tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{').gsub('#','\#'))
299
301
  if (packets[tmp[0]] || (tmp[0]=="mi"||tmp[0]=="mb"||tmp[0]=="di"))
300
302
  if (tmp[0]=="t"||tmp[0]=="ts"||tmp[0]=="a"||tmp[0]=="cl")
301
303
  packets[tmp[0]] += tmp[1..-1]
@@ -349,8 +351,8 @@ module GMailer
349
351
  matches = inbox.scan(/D\((.*)\)/).flatten
350
352
  packets = {}
351
353
  matches.each do |x|
352
- x = unescapeHTML(x)
353
- tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{'))
354
+ x = unescapeHTML(x)
355
+ tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{').gsub('#','\#'))
354
356
  if (packets[tmp[0]] || (tmp[0]=="mi"||tmp[0]=="mb"||tmp[0]=="di"))
355
357
  if (tmp[0]=="t"||tmp[0]=="ts"||tmp[0]=="a"||tmp[0]=="cl")
356
358
  packets[tmp[0]] += tmp[1..-1]
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: gmailer
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.9
7
- date: 2007-11-07 00:00:00 +09:00
6
+ version: 0.2.0
7
+ date: 2007-11-20 00:00:00 +09:00
8
8
  summary: An class interface of the Google's webmail service
9
9
  require_paths:
10
10
  - ""