vmail 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vmail/reply_template.rb +10 -1
- data/lib/vmail/version.rb +1 -1
- metadata +2 -2
data/lib/vmail/reply_template.rb
CHANGED
@@ -10,7 +10,7 @@ module Vmail
|
|
10
10
|
@mail = Mail.new(mail)
|
11
11
|
end
|
12
12
|
|
13
|
-
def reply_headers
|
13
|
+
def reply_headers(try_again = true)
|
14
14
|
formatter = Vmail::MessageFormatter.new(@mail)
|
15
15
|
headers = formatter.extract_headers
|
16
16
|
subject = headers['subject']
|
@@ -21,6 +21,15 @@ module Vmail
|
|
21
21
|
quote_header = "On #{date.strftime('%a, %b %d, %Y at %I:%M %p')}, #{sender} wrote:\n\n"
|
22
22
|
body = quote_header + formatter.process_body.gsub(/^(?=>)/, ">").gsub(/^(?!>)/, "> ")
|
23
23
|
{'from' => "#@name <#@username>", 'to' => primary_recipient, 'cc' => cc, 'subject' => subject, :body => body}
|
24
|
+
rescue NoMethodError
|
25
|
+
# a total hack TODO but stopgap
|
26
|
+
if try_again
|
27
|
+
log "reply_headers trying again STOPGAP"
|
28
|
+
sleep 0.3
|
29
|
+
return reply_headers(false) # try one more time
|
30
|
+
else
|
31
|
+
raise
|
32
|
+
end
|
24
33
|
end
|
25
34
|
|
26
35
|
def primary_recipient
|
data/lib/vmail/version.rb
CHANGED