Fixed bug: Error while logging in to some IMAP services (e.g. Outlook365.)
This commit is contained in:
parent
45627716c9
commit
c584d96360
1 changed files with 1 additions and 9 deletions
|
@ -68,15 +68,7 @@ returns
|
|||
@imap = Net::IMAP.new(options[:host], port, ssl, nil, false)
|
||||
end
|
||||
|
||||
# try LOGIN, if not - try plain
|
||||
begin
|
||||
@imap.authenticate('LOGIN', options[:user], options[:password])
|
||||
rescue => e
|
||||
if e.to_s !~ /(unsupported\s(authenticate|authentication)\smechanism|not\ssupported)/i
|
||||
raise e
|
||||
end
|
||||
@imap.login(options[:user], options[:password])
|
||||
end
|
||||
@imap.login(options[:user], options[:password])
|
||||
|
||||
# select folder
|
||||
if !options[:folder] || options[:folder].empty?
|
||||
|
|
Loading…
Reference in a new issue