|
|
@@ -322,7 +322,7 @@ module Agents
|
322
|
322
|
port = (Integer(port) if port.present?)
|
323
|
323
|
|
324
|
324
|
log "Connecting to #{host}#{':%d' % port if port}#{' via SSL' if ssl}"
|
325
|
|
- Client.open(host, port, ssl) { |imap|
|
|
325
|
+ Client.open(host, port: port, ssl: ssl) { |imap|
|
326
|
326
|
log "Logging in as #{username}"
|
327
|
327
|
imap.login(username, interpolated[:password])
|
328
|
328
|
|
|
|
@@ -437,8 +437,8 @@ module Agents
|
437
|
437
|
|
438
|
438
|
class Client < ::Net::IMAP
|
439
|
439
|
class << self
|
440
|
|
- def open(host, port, ssl)
|
441
|
|
- imap = new(host, port, ssl)
|
|
440
|
+ def open(host, *args)
|
|
441
|
+ imap = new(host, *args)
|
442
|
442
|
yield imap
|
443
|
443
|
ensure
|
444
|
444
|
imap.disconnect unless imap.nil?
|