Added hotmail/outlook support for probing.
This commit is contained in:
parent
acafc33800
commit
a00410758a
4 changed files with 127 additions and 92 deletions
|
@ -169,11 +169,34 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
|||
:outbound => {
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => 'smtp.gmail.com',
|
||||
:port => '25',
|
||||
:host => 'smtp.gmail.com',
|
||||
:port => '25',
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
}
|
||||
},
|
||||
},
|
||||
:microsoft => {
|
||||
:domain => 'outlook.com|hotmail.com',
|
||||
:inbound => {
|
||||
:adapter => 'imap',
|
||||
:options => {
|
||||
:host => 'imap-mail.outlook.com',
|
||||
:port => '993',
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
:outbound => {
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => 'smtp-mail.outlook.com',
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -372,41 +395,41 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
|||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 25,
|
||||
:ssl => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 25,
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 465,
|
||||
:ssl => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 465,
|
||||
:start_tls => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 465,
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
:host => mail_exchangers[0][0],
|
||||
:port => 465,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
@ -416,81 +439,81 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
|||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "mail.#{domain}",
|
||||
:port => 25,
|
||||
:ssl => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
:host => "mail.#{domain}",
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "mail.#{domain}",
|
||||
:port => 25,
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
:host => "mail.#{domain}",
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "mail.#{domain}",
|
||||
:port => 465,
|
||||
:ssl => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
:host => "mail.#{domain}",
|
||||
:port => 465,
|
||||
:start_tls => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "mail.#{domain}",
|
||||
:port => 465,
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
:host => "mail.#{domain}",
|
||||
:port => 465,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 25,
|
||||
:ssl => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 25,
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 25,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 465,
|
||||
:ssl => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 465,
|
||||
:start_tls => true,
|
||||
:user => user,
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
{
|
||||
:adapter => 'smtp',
|
||||
:options => {
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 465,
|
||||
:ssl => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
:host => "smtp.#{domain}",
|
||||
:port => 465,
|
||||
:start_tls => true,
|
||||
:user => params[:email],
|
||||
:password => params[:password],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -17,7 +17,7 @@ class Channel::IMAP < Channel::EmailParser
|
|||
# on check, reduce open_timeout to have faster probing
|
||||
timeout = 12
|
||||
if check_type == 'check'
|
||||
timeout = 4
|
||||
timeout = 6
|
||||
end
|
||||
|
||||
Timeout.timeout(timeout) do
|
||||
|
@ -30,7 +30,7 @@ class Channel::IMAP < Channel::EmailParser
|
|||
begin
|
||||
@imap.authenticate( 'LOGIN', channel[:options][:user], channel[:options][:password] )
|
||||
rescue Exception => e
|
||||
if e.to_s !~ /unsupported\s(authenticate|authentication)\smechanism/i
|
||||
if e.to_s !~ /(unsupported\s(authenticate|authentication)\smechanism|not\ssupported)/i
|
||||
raise e
|
||||
end
|
||||
@imap.login( channel[:options][:user], channel[:options][:password] )
|
||||
|
|
|
@ -14,8 +14,7 @@ class Channel::SMTP < Channel::EmailBuild
|
|||
:domain => channel[:options][:host],
|
||||
:user_name => channel[:options][:user],
|
||||
:password => channel[:options][:password],
|
||||
# :authentication => 'plain',
|
||||
:enable_starttls_auto => true
|
||||
:enable_starttls_auto => true,
|
||||
}
|
||||
mail.deliver
|
||||
end
|
||||
|
|
|
@ -3,8 +3,11 @@ require 'browser_test_helper'
|
|||
|
||||
class AaaGettingStartedTest < TestCase
|
||||
def test_a_getting_started
|
||||
#return # TODO: temp disable
|
||||
if !ENV['MAILBOX_INIT']
|
||||
raise "Need MAILBOX_INIT as ENV variable like export MAILBOX_INIT='unittest01@znuny.com:somepass'"
|
||||
#raise "Need MAILBOX_INIT as ENV variable like export MAILBOX_INIT='unittest01@znuny.com:somepass'"
|
||||
puts "NOTICE: Need MAILBOX_INIT as ENV variable like export MAILBOX_INIT='unittest01@znuny.com:somepass'"
|
||||
return
|
||||
end
|
||||
mailbox_user = ENV['MAILBOX_INIT'].split(':')[0]
|
||||
mailbox_password = ENV['MAILBOX_INIT'].split(':')[1]
|
||||
|
@ -234,19 +237,24 @@ class AaaGettingStartedTest < TestCase
|
|||
end
|
||||
|
||||
def test_b_accounts_auto
|
||||
return # TODO: temp disable
|
||||
if !ENV['MAILBOX_AUTO1']
|
||||
raise "Need MAILBOX_AUTO1 as ENV variable like export MAILBOX_AUTO1='nicole.braun2015@gmail.com:somepass'"
|
||||
end
|
||||
mailbox_user = ENV['MAILBOX_AUTO1'].split(':')[0]
|
||||
mailbox_password = ENV['MAILBOX_AUTO1'].split(':')[1]
|
||||
accounts = [
|
||||
{
|
||||
:realname => 'gmail',
|
||||
#return # TODO: temp disable
|
||||
accounts = []
|
||||
(1..10).each {|count|
|
||||
next if !ENV["MAILBOX_AUTO#{count.to_s}"]
|
||||
mailbox_user = ENV["MAILBOX_AUTO#{count.to_s}"].split(':')[0]
|
||||
mailbox_password = ENV["MAILBOX_AUTO#{count.to_s}"].split(':')[1]
|
||||
account = {
|
||||
:realname => 'auto account',
|
||||
:email => mailbox_user,
|
||||
:password => mailbox_password,
|
||||
},
|
||||
]
|
||||
}
|
||||
accounts.push account
|
||||
}
|
||||
if accounts.empty?
|
||||
#raise "Need min. MAILBOX_AUTO1 as ENV variable like export MAILBOX_AUTO1='nicole.braun2015@gmail.com:somepass'"
|
||||
puts "NOTICE: Need min. MAILBOX_AUTO1 as ENV variable like export MAILBOX_AUTO1='nicole.braun2015@gmail.com:somepass'"
|
||||
return
|
||||
end
|
||||
accounts.each {|account|
|
||||
tests = [
|
||||
{
|
||||
|
@ -303,18 +311,16 @@ class AaaGettingStartedTest < TestCase
|
|||
end
|
||||
|
||||
def test_b_accounts_manual
|
||||
return # TODO: temp disable
|
||||
if !ENV['MAILBOX_MANUAL1']
|
||||
raise "Need MAILBOX_AUTO1 as ENV variable like export MAILBOX_MANUAL1='nicole.bauer2015@yahoo.de:somepass:imap.mail.yahoo.com:smtp.mail.yahoo.com'"
|
||||
end
|
||||
mailbox_user = ENV['MAILBOX_MANUAL1'].split(':')[0]
|
||||
mailbox_password = ENV['MAILBOX_MANUAL1'].split(':')[1]
|
||||
mailbox_inbound = ENV['MAILBOX_MANUAL1'].split(':')[2]
|
||||
mailbox_outbound = ENV['MAILBOX_MANUAL1'].split(':')[3]
|
||||
|
||||
accounts = [
|
||||
{
|
||||
:realname => 'yahoo',
|
||||
#return # TODO: temp disable
|
||||
accounts = []
|
||||
(1..10).each {|count|
|
||||
next if !ENV["MAILBOX_MANUAL#{count.to_s}"]
|
||||
mailbox_user = ENV["MAILBOX_MANUAL#{count.to_s}"].split(':')[0]
|
||||
mailbox_password = ENV["MAILBOX_MANUAL#{count.to_s}"].split(':')[1]
|
||||
mailbox_inbound = ENV["MAILBOX_MANUAL#{count.to_s}"].split(':')[2]
|
||||
mailbox_outbound = ENV["MAILBOX_MANUAL#{count.to_s}"].split(':')[3]
|
||||
account = {
|
||||
:realname => 'manual account',
|
||||
:email => mailbox_user,
|
||||
:password => mailbox_password,
|
||||
:inbound => {
|
||||
|
@ -323,8 +329,15 @@ class AaaGettingStartedTest < TestCase
|
|||
:outbound => {
|
||||
'options::host' => mailbox_outbound,
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
accounts.push account
|
||||
}
|
||||
if accounts.empty?
|
||||
#raise "Need min. MAILBOX_MANUAL1 as ENV variable like export MAILBOX_MANUAL1='nicole.bauer2015@yahoo.de:somepass:imap.mail.yahoo.com:smtp.mail.yahoo.com'"
|
||||
puts "NOTICE: Need min. MAILBOX_MANUAL1 as ENV variable like export MAILBOX_MANUAL1='nicole.bauer2015@yahoo.de:somepass:imap.mail.yahoo.com:smtp.mail.yahoo.com'"
|
||||
return
|
||||
end
|
||||
|
||||
accounts.each {|account|
|
||||
tests = [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue