gmailer 0.1.8 → 0.1.9

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.
Files changed (4) hide show
  1. data/CHANGES +4 -0
  2. data/gmailer.gempsec +1 -1
  3. data/gmailer.rb +32 -18
  4. metadata +2 -2
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.1.9 - 7-Nov-2007
2
+ - fix connection problem with some accounts
3
+ - fix newer UI to old UI conversion
4
+
1
5
  == 0.1.8 - 29-Sep-2007
2
6
  - some source code refactoring
3
7
  - fix contact_group typo
data/gmailer.gempsec CHANGED
@@ -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.8"
5
+ gem.version = "0.1.9"
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.8"
55
+ VERSION = "0.1.9"
56
56
  attr_accessor :connection
57
57
 
58
58
  # the main class.
@@ -158,7 +158,7 @@ module GMailer
158
158
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
159
159
  result = ''
160
160
  response = nil
161
- np.set_debug_output($stderr) if DEBUG
161
+ np.set_debug_output($stdout) if DEBUG
162
162
  np.start { |http|
163
163
  response = http.post(GM_LNK_LOGIN, postdata,{'Content-Type' => 'application/x-www-form-urlencoded','User-agent' => GM_USER_AGENT} )
164
164
  result = response.body
@@ -176,7 +176,7 @@ module GMailer
176
176
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
177
177
  result = ''
178
178
  response = nil
179
- np.set_debug_output($stderr) if DEBUG
179
+ np.set_debug_output($stdout) if DEBUG
180
180
  np.start { |http|
181
181
  response = http.get(arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
182
182
  result = response.body
@@ -187,7 +187,7 @@ module GMailer
187
187
  result = ''
188
188
  cookies += ';'+ __cookies(response['set-cookie'])
189
189
  response = nil
190
- np.set_debug_output($stderr) 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
@@ -201,19 +201,33 @@ module GMailer
201
201
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
202
202
  result = ''
203
203
  response = nil
204
- np.set_debug_output($stderr) if DEBUG
204
+ np.set_debug_output($stdout) if DEBUG
205
205
  np.start { |http|
206
- response = http.get(arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
206
+ response = http.get("http://"+arr[2]+arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
207
207
  result = response.body
208
208
  }
209
209
  end
210
-
210
+
211
+ if arr[2]!="mail.google.com" && response["Location"]!=nil
212
+ arr = URI::split(response["Location"])
213
+ np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
214
+ np.use_ssl = true
215
+ np.verify_mode = OpenSSL::SSL::VERIFY_NONE
216
+ result = ''
217
+ response = nil
218
+ np.set_debug_output($stdout) if DEBUG
219
+ np.start { |http|
220
+ response = http.get("http://"+arr[2]+arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
221
+ result = response.body
222
+ }
223
+ end
224
+
211
225
  @loc = "http://mail.google.com/mail/"
212
226
  cookies += ';' + __cookies(response['set-cookie'])
213
227
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
214
228
  np.use_ssl = true
215
229
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
216
- np.set_debug_output($stderr) if DEBUG
230
+ np.set_debug_output($stdout) if DEBUG
217
231
  np.start { |http|
218
232
  response = http.get(@loc, {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
219
233
  result = response.body
@@ -251,10 +265,10 @@ module GMailer
251
265
  if connected?
252
266
  query += "&zv=" + (rand(2000)*2147483.648).to_i.to_s
253
267
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
254
- np.set_debug_output($stderr) if DEBUG
268
+ np.set_debug_output($stdout) if DEBUG
255
269
  inbox = ''
256
270
  np.start { |http|
257
- response = http.get(GM_LNK_GMAIL + "?" + query,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT })
271
+ response = http.get(GM_LNK_GMAIL + "?ui=1&" + query,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT })
258
272
  inbox = response.body
259
273
  }
260
274
  if @type == GM_SHOWORIGINAL
@@ -1121,7 +1135,7 @@ module GMailer
1121
1135
 
1122
1136
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
1123
1137
  response = nil
1124
- np.set_debug_output($stderr) if DEBUG
1138
+ np.set_debug_output($stdout) if DEBUG
1125
1139
  np.start { |http|
1126
1140
  response = http.post(GM_LNK_GMAIL, postdata,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT,'Content-type' => 'multipart/form-data; boundary=' + boundary } )
1127
1141
  }
@@ -1185,7 +1199,7 @@ module GMailer
1185
1199
  end
1186
1200
 
1187
1201
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
1188
- np.set_debug_output($stderr) if DEBUG
1202
+ np.set_debug_output($stdout) if DEBUG
1189
1203
  np.start { |http|
1190
1204
  response = http.post(link, postdata,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT} )
1191
1205
  result = response.body
@@ -1206,13 +1220,13 @@ module GMailer
1206
1220
 
1207
1221
  response = nil
1208
1222
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
1209
- np.set_debug_output($stderr) if DEBUG
1223
+ np.set_debug_output($stdout) if DEBUG
1210
1224
  np.start { |http|
1211
1225
  response = http.get(GM_LNK_LOGOUT,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT })
1212
1226
  }
1213
1227
  arr = URI::split(response["Location"])
1214
1228
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 80)
1215
- np.set_debug_output($stderr) if DEBUG
1229
+ np.set_debug_output($stdout) if DEBUG
1216
1230
  np.start { |http|
1217
1231
  response = http.get(arr[5]+'?'+arr[7], {'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT} )
1218
1232
  }
@@ -1272,7 +1286,7 @@ module GMailer
1272
1286
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 443)
1273
1287
  np.use_ssl = true
1274
1288
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
1275
- np.set_debug_output($stderr) if DEBUG
1289
+ np.set_debug_output($stdout) if DEBUG
1276
1290
  np.start { |http|
1277
1291
  response = http.post(link, postdata,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT} )
1278
1292
  }
@@ -1406,7 +1420,7 @@ module GMailer
1406
1420
  link = GM_LNK_GMAIL + "?view=up"
1407
1421
 
1408
1422
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
1409
- np.set_debug_output($stderr) if DEBUG
1423
+ np.set_debug_output($stdout) if DEBUG
1410
1424
  np.start { |http|
1411
1425
  response = http.post(link, postdata,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT} )
1412
1426
  parse_response(response.body)
@@ -1448,7 +1462,7 @@ module GMailer
1448
1462
  query += "&m="+message_id.to_s
1449
1463
 
1450
1464
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
1451
- np.set_debug_output($stderr) if DEBUG
1465
+ np.set_debug_output($stdout) if DEBUG
1452
1466
  np.start { |http|
1453
1467
  response = http.get(GM_LNK_GMAIL + "?" + query,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT })
1454
1468
  }
@@ -1484,7 +1498,7 @@ module GMailer
1484
1498
 
1485
1499
  np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(GM_LNK_HOST, 80)
1486
1500
  response = nil
1487
- np.set_debug_output($stderr) if DEBUG
1501
+ np.set_debug_output($stdout) if DEBUG
1488
1502
  if (id.is_a?(Array))
1489
1503
  np.start { |http|
1490
1504
  response = http.post(GM_LNK_GMAIL+"?view=up", query,{'Cookie' => @cookie_str,'User-agent' => GM_USER_AGENT} )
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.8
7
- date: 2007-09-29 00:00:00 +09:00
6
+ version: 0.1.9
7
+ date: 2007-11-07 00:00:00 +09:00
8
8
  summary: An class interface of the Google's webmail service
9
9
  require_paths:
10
10
  - ""