vmail 0.5.8 → 0.5.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.
- data/lib/vmail/imap_client.rb +9 -3
- data/lib/vmail/reply_template.rb +5 -0
- data/lib/vmail/version.rb +1 -1
- metadata +2 -2
data/lib/vmail/imap_client.rb
CHANGED
@@ -515,10 +515,10 @@ EOF
|
|
515
515
|
end
|
516
516
|
|
517
517
|
|
518
|
-
def new_message_template
|
518
|
+
def new_message_template(subject = nil)
|
519
519
|
headers = {'from' => "#{@name} <#{@username}>",
|
520
520
|
'to' => nil,
|
521
|
-
'subject' =>
|
521
|
+
'subject' => subject
|
522
522
|
}
|
523
523
|
format_headers(headers) + "\n\n" + signature
|
524
524
|
end
|
@@ -550,7 +550,13 @@ EOF
|
|
550
550
|
|
551
551
|
def forward_template
|
552
552
|
original_body = @current_message.split(/\n-{20,}\n/, 2)[1]
|
553
|
-
|
553
|
+
formatter = Vmail::MessageFormatter.new(@current_mail)
|
554
|
+
headers = formatter.extract_headers
|
555
|
+
subject = headers['subject']
|
556
|
+
if subject !~ /Fwd: /
|
557
|
+
subject = "Fwd: #{subject}"
|
558
|
+
end
|
559
|
+
new_message_template(subject) +
|
554
560
|
"\n---------- Forwarded message ----------\n" +
|
555
561
|
original_body + signature
|
556
562
|
end
|
data/lib/vmail/reply_template.rb
CHANGED
@@ -23,6 +23,11 @@ module Vmail
|
|
23
23
|
{'from' => "#@name <#@username>", 'to' => primary_recipient, 'cc' => cc, 'subject' => subject, :body => body}
|
24
24
|
end
|
25
25
|
|
26
|
+
# just stick this here
|
27
|
+
def forward_headers
|
28
|
+
|
29
|
+
end
|
30
|
+
|
26
31
|
def primary_recipient
|
27
32
|
from = @mail.header['from']
|
28
33
|
reply_to = @mail.header['reply-to']
|
data/lib/vmail/version.rb
CHANGED