Skip to content

Commit

Permalink
added some user prompts for imap. updated so the regex also is now ca…
Browse files Browse the repository at this point in the history
…se insensitive and searches for auth disable/disallowed
  • Loading branch information
CausticKirbyZ committed Oct 12, 2023
1 parent ce32e53 commit 1a1a4b3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/spray_types/imap.cr
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,24 @@ class IMAP < Sprayer
if i =~ /^tag OK/
resp << i
break
elsif i =~ /^tag NO Authentication disabled/
elsif i =~ /Authentication (disabled|disallowed)/i
STDERR.puts "\n(#{username}, #{password} , #{host}) - Authentication disabled/disallowed Try Using SSL/TLS(IMAPS)"
raise "Use change to tls or try not using tls"
elsif i =~ /^tag NO Invalid credentials/
raise "Invalid Credentials"
elsif i =~ /^tag NO/
raise "Command error"
elsif i =~ /^tag BAD/
raise "Unknown command or arguments invalid"
elsif i =~ /Invalid credentials/i
# raise "Invalid Credentials"
return false
elsif i =~ /^tag NO/i
STDERR.puts "\n(#{username}, #{password} , #{host}) - Command error: RESULT: #{i}"
raise "Command error: RESULT: #{i}"
elsif i =~ /^tag BAD/i
STDERR.puts "\n(#{username}, #{password} , #{host}) - Unknown command or arguments invalid: #{i}\n".colorize(:red)
raise "Unknown command or arguments invalid: #{i}"
else
resp << i
end
end

if resp.join(" ") =~ /LOGIN completed/
if resp.join(" ") =~ /LOGIN completed/i
return true
end
return false
Expand Down

0 comments on commit 1a1a4b3

Please sign in to comment.