[username, password]
end
-
educate_user if ARGV.member? '--help'
archive = ARGV.delete "--archive"
@ids = []
@labels = [:unread]
@labels << :inbox unless archived?
- @labels << mailbox.intern unless mailbox =~ /inbox/i || mailbox.nil?
+ @labels << mailbox.intern unless mailbox =~ /inbox/i
@mutex = Mutex.new
end
def host; @parsed_uri.host; end
def port; @parsed_uri.port || (ssl? ? 993 : 143); end
- def mailbox; @parsed_uri.path[1..-1] || 'INBOX'; end
+ def mailbox
+ x = @parsed_uri.path[1..-1]
+ x.empty? ? 'INBOX' : x
+ end
def ssl?; @parsed_uri.scheme == 'imaps' end
def load_header id
begin
retries = 0
connect
- # MBox::debug "sending command: #{cmd.inspect}"
+ MBox::debug "sending command: #{cmd.inspect}"
begin
result = @shell.send_command cmd
- result = @shell.sync { @shell.send_command cmd }
raise SSHFileError, "Failure during remote command #{cmd.inspect}: #{(result.stderr || result.stdout || "")[0 .. 100]}" unless result.status == 0
rescue Net::SSH::Exception # these happen occasionally for no apparent reason. gotta love that nondeterminism!
retry if (retries += 1) <= 3