vmail 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +19 -0
- data/lib/vmail.vim +1 -1
- data/lib/vmail/imap_client.rb +4 -2
- data/lib/vmail/reply_template.rb +6 -6
- data/lib/vmail/version.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -5,6 +5,25 @@ Bundler::GemHelper.install_tasks
|
|
5
5
|
|
6
6
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
|
7
7
|
|
8
|
+
desc "release and build and push new website"
|
9
|
+
task :push => [:release, :web]
|
10
|
+
|
11
|
+
desc "Bumps version number up one and git commits"
|
12
|
+
task :bump do
|
13
|
+
basefile = "lib/vmail/version.rb"
|
14
|
+
file = File.read(basefile)
|
15
|
+
oldver = file[/VERSION = '(\d.\d.\d)'/, 1]
|
16
|
+
newver_i = oldver.gsub(".", '').to_i + 1
|
17
|
+
newver = ("%.3d" % newver_i).split(//).join('.')
|
18
|
+
puts oldver
|
19
|
+
puts newver
|
20
|
+
puts "Bumping version: #{oldver} => #{newver}"
|
21
|
+
newfile = file.gsub("VERSION = '#{oldver}'", "VERSION = '#{newver}'")
|
22
|
+
File.open(basefile, 'w') {|f| f.write newfile}
|
23
|
+
`git commit -am 'Bump'`
|
24
|
+
end
|
25
|
+
|
26
|
+
|
8
27
|
desc "build and push website"
|
9
28
|
task :web do
|
10
29
|
require 'vmail/version'
|
data/lib/vmail.vim
CHANGED
@@ -634,8 +634,8 @@ function! s:send_message()
|
|
634
634
|
if match(res, '^Failed') == -1
|
635
635
|
call s:close_and_focus_list_window()
|
636
636
|
endif
|
637
|
-
redraw
|
638
637
|
echom substitute(res, '[\s\r\n]\+$', '', '')
|
638
|
+
redraw
|
639
639
|
endfunction
|
640
640
|
|
641
641
|
" --------------------------------------------------------------------------------
|
data/lib/vmail/imap_client.rb
CHANGED
@@ -20,6 +20,7 @@ module Vmail
|
|
20
20
|
@username, @password = config['username'], config['password']
|
21
21
|
@name = config['name']
|
22
22
|
@signature = config['signature']
|
23
|
+
@always_cc = config['always_cc']
|
23
24
|
@mailbox = nil
|
24
25
|
@logger = Logger.new(config['logfile'] || STDERR)
|
25
26
|
@logger.level = Logger::DEBUG
|
@@ -612,7 +613,8 @@ EOF
|
|
612
613
|
def new_message_template(subject = nil, append_signature = true)
|
613
614
|
headers = {'from' => "#{@name} <#{@username}>",
|
614
615
|
'to' => nil,
|
615
|
-
'subject' => subject
|
616
|
+
'subject' => subject,
|
617
|
+
'cc' => @always_cc
|
616
618
|
}
|
617
619
|
format_headers(headers) + (append_signature ? ("\n\n" + signature) : "\n\n")
|
618
620
|
end
|
@@ -635,7 +637,7 @@ EOF
|
|
635
637
|
return nil
|
636
638
|
end
|
637
639
|
# user reply_template class
|
638
|
-
reply_headers = Vmail::ReplyTemplate.new(@current_mail, @username, @name, replyall).reply_headers
|
640
|
+
reply_headers = Vmail::ReplyTemplate.new(@current_mail, @username, @name, replyall, @always_cc).reply_headers
|
639
641
|
body = reply_headers.delete(:body)
|
640
642
|
format_headers(reply_headers) + "\n\n\n" + body + signature
|
641
643
|
end
|
data/lib/vmail/reply_template.rb
CHANGED
@@ -5,8 +5,8 @@ require 'time'
|
|
5
5
|
module Vmail
|
6
6
|
class ReplyTemplate
|
7
7
|
|
8
|
-
def initialize(mail, username, name, replyall)
|
9
|
-
@username, @name, @replyall = username, name, replyall
|
8
|
+
def initialize(mail, username, name, replyall, always_cc=nil)
|
9
|
+
@username, @name, @replyall, @always_cc = username, name, replyall, always_cc
|
10
10
|
@mail = Mail.new(mail)
|
11
11
|
end
|
12
12
|
|
@@ -34,15 +34,15 @@ module Vmail
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def cc
|
37
|
-
return nil unless @replyall
|
37
|
+
return nil unless (@replyall || @always_cc)
|
38
38
|
cc = @mail.header['to'].value.split(/,\s*/)
|
39
39
|
if @mail.header['cc']
|
40
40
|
cc += @mail.header['cc'].value.split(/,\s*/)
|
41
41
|
end
|
42
42
|
cc = cc.flatten.compact.
|
43
|
-
select {|x|
|
44
|
-
|
45
|
-
|
43
|
+
select {|x| x.to_s[/<([^>]+)>/, 1] !~ /#{@username}/ && x.to_s[/^[^<]+/, 1] !~ /#{@name}/ }
|
44
|
+
cc << @always_cc
|
45
|
+
cc.join(', ')
|
46
46
|
end
|
47
47
|
|
48
48
|
def sender
|
data/lib/vmail/version.rb
CHANGED