Fixed bug: Error while logging in to some IMAP services (e.g. Outlook365.)

This commit is contained in:
Thorsten Eckel 2016-11-05 16:28:14 +01:00
parent 45627716c9
commit c584d96360

View file

@ -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?