gmailer 0.1.4 → 0.1.5

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 +4 -0
  2. data/gmailer.gempsec +1 -1
  3. data/gmailer.rb +28 -14
  4. metadata +2 -2
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.1.5 - 25-Jan-2007
2
+ - fix bad URI problem connection problem for some accounts
3
+ - add :ishtml parameter to specify the mail should be sent as text or as HTML
4
+
1
5
  == 0.1.4 - 22-Dec-2006
2
6
  - fix send mail problem in multi from account
3
7
 
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.4"
5
+ gem.version = "0.1.5"
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.4"
55
+ VERSION = "0.1.5"
56
56
  attr_accessor :connection
57
57
 
58
58
  # the main class.
@@ -168,23 +168,37 @@ module GMailer
168
168
  np.verify_mode = OpenSSL::SSL::VERIFY_NONE
169
169
  result = ''
170
170
  response = nil
171
- # np.set_debug_output($stderr)
171
+ # np.set_debug_output($stderr)
172
172
  np.start { |http|
173
173
  response = http.get(arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
174
174
  result = response.body
175
175
  }
176
176
 
177
- arr = URI::split(response["Location"])
178
- np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
179
- np.use_ssl = true
180
- np.verify_mode = OpenSSL::SSL::VERIFY_NONE
181
- result = ''
182
- response = nil
183
- # np.set_debug_output($stderr)
184
- np.start { |http|
185
- response = http.get(arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
186
- result = response.body
187
- }
177
+ if result.include?("Redirecting") && result =~ /url='(.+?)'/
178
+ url = $1.gsub("&","&")
179
+ result = ''
180
+ cookies += ';'+ __cookies(response['set-cookie'])
181
+ response = nil
182
+ # np.set_debug_output($stderr)
183
+ np.start { |http|
184
+ response = http.get(url, {'Cookie' => cookies,'User-agent'=> GM_USER_AGENT} )
185
+ result = response.body
186
+ }
187
+ end
188
+
189
+ if response["Location"]!=nil
190
+ arr = URI::split(response["Location"])
191
+ np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
192
+ np.use_ssl = true
193
+ np.verify_mode = OpenSSL::SSL::VERIFY_NONE
194
+ result = ''
195
+ response = nil
196
+ # np.set_debug_output($stderr)
197
+ np.start { |http|
198
+ response = http.get(arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
199
+ result = response.body
200
+ }
201
+ end
188
202
 
189
203
  @loc = "http://mail.google.com/mail/"
190
204
  cookies += ';' + __cookies(response['set-cookie'])
@@ -985,7 +999,7 @@ module GMailer
985
999
  postdata["bcc"] = stripslashes(bcc)
986
1000
 
987
1001
  postdata["cmid"] = 1
988
- postdata["ishtml"] = 0
1002
+ postdata["ishtml"] = param[:ishtml] || 0
989
1003
 
990
1004
  cc = @cookie_str.split(';')
991
1005
  cc.each {|cc_part|
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: gmailer
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.4
7
- date: 2006-12-22 00:00:00 +09:00
6
+ version: 0.1.5
7
+ date: 2007-01-25 00:00:00 +09:00
8
8
  summary: An class interface of the Google's webmail service
9
9
  require_paths:
10
10
  - ""