vmail 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vmail.rb +11 -5
- data/lib/vmail/imap_client.rb +4 -1
- data/lib/vmail/version.rb +1 -1
- metadata +2 -2
data/lib/vmail.rb
CHANGED
@@ -56,15 +56,21 @@ module Vmail
|
|
56
56
|
puts "query: #{query.inspect}"
|
57
57
|
|
58
58
|
buffer_file = "vmailbuffer"
|
59
|
+
# invoke vim
|
60
|
+
vimscript = File.expand_path("../vmail.vim", __FILE__)
|
61
|
+
vim_command = "DRB_URI=#{drb_uri} VMAIL_CONTACTS_FILE=#{contacts_file} VMAIL_MAILBOX=#{String.shellescape(mailbox)} VMAIL_QUERY=#{String.shellescape(query.join(' '))} #{vim} -S #{vimscript} #{buffer_file}"
|
62
|
+
puts vim_command
|
63
|
+
|
59
64
|
puts "using buffer file: #{buffer_file}"
|
60
65
|
File.open(buffer_file, "w") do |file|
|
66
|
+
file.puts "vmail starting with values:"
|
67
|
+
file.puts "- drb uri: #{drb_uri}"
|
68
|
+
file.puts "- mailbox: #{mailbox}"
|
69
|
+
file.puts "- query: #{query.join(' ')}"
|
70
|
+
file.puts
|
61
71
|
file.puts "fetching messages. please wait..."
|
62
72
|
end
|
63
73
|
|
64
|
-
# invoke vim
|
65
|
-
vimscript = File.expand_path("../vmail.vim", __FILE__)
|
66
|
-
vim_command = "DRB_URI=#{drb_uri} VMAIL_CONTACTS_FILE=#{contacts_file} VMAIL_MAILBOX=#{String.shellescape(mailbox)} VMAIL_QUERY=#{String.shellescape(query.join(' '))} #{vim} -S #{vimscript} #{buffer_file}"
|
67
|
-
puts vim_command
|
68
74
|
system(vim_command)
|
69
75
|
|
70
76
|
if vim == 'mvim'
|
@@ -75,7 +81,7 @@ module Vmail
|
|
75
81
|
|
76
82
|
puts "closing imap connection"
|
77
83
|
begin
|
78
|
-
Timeout::timeout(
|
84
|
+
Timeout::timeout(10) do
|
79
85
|
$gmail.close
|
80
86
|
end
|
81
87
|
rescue Timeout::Error
|
data/lib/vmail/imap_client.rb
CHANGED
@@ -56,8 +56,11 @@ module Vmail
|
|
56
56
|
reconnect_if_necessary do
|
57
57
|
log @imap.select(mailbox)
|
58
58
|
end
|
59
|
+
log "done"
|
59
60
|
@mailbox = mailbox
|
61
|
+
log "getting mailbox status"
|
60
62
|
get_mailbox_status
|
63
|
+
log "getting highest message id"
|
61
64
|
get_highest_message_id
|
62
65
|
return "OK"
|
63
66
|
end
|
@@ -746,7 +749,7 @@ trap("INT") {
|
|
746
749
|
require 'timeout'
|
747
750
|
puts "closing imap connection"
|
748
751
|
begin
|
749
|
-
Timeout::timeout(
|
752
|
+
Timeout::timeout(10) do
|
750
753
|
$gmail.close
|
751
754
|
end
|
752
755
|
rescue Timeout::Error
|
data/lib/vmail/version.rb
CHANGED