Fix send mail bug.
This commit is contained in:
parent
9f94440cdc
commit
ecdbe51c92
|
@ -30,7 +30,7 @@ namespace :epaper do
|
||||||
site = Site.first
|
site = Site.first
|
||||||
@address = site['site_settings']['address']
|
@address = site['site_settings']['address']
|
||||||
@port = (site['site_settings']['port'].to_i rescue 587)
|
@port = (site['site_settings']['port'].to_i rescue 587)
|
||||||
@open_timeout = 30
|
@open_timeout = 10
|
||||||
@read_timeout = 60
|
@read_timeout = 60
|
||||||
@debug_output = nil
|
@debug_output = nil
|
||||||
tls = (site['site_settings']['enable_starttls_auto'] == "1")
|
tls = (site['site_settings']['enable_starttls_auto'] == "1")
|
||||||
|
@ -83,12 +83,17 @@ namespace :epaper do
|
||||||
check_list = check_emails
|
check_list = check_emails
|
||||||
end
|
end
|
||||||
check_list.each do |check_email|
|
check_list.each do |check_email|
|
||||||
|
begin
|
||||||
res1 = epaper_get_response("RCPT TO:<#{check_email}>")
|
res1 = epaper_get_response("RCPT TO:<#{check_email}>")
|
||||||
res2 = epaper_get_response("RCPT TO:<#{check_email}>")
|
res2 = epaper_get_response("RCPT TO:<#{check_email}>")
|
||||||
if !(res1.success? && res2.success?)
|
if !(res1.success? && res2.success?)
|
||||||
invalid_emails << check_email
|
invalid_emails << check_email
|
||||||
puts [check_email,res1.message,res2.message]
|
puts [check_email,res1.message,res2.message]
|
||||||
end
|
end
|
||||||
|
rescue => e
|
||||||
|
puts e.to_s
|
||||||
|
invalid_emails << check_email
|
||||||
|
end
|
||||||
end
|
end
|
||||||
s.close
|
s.close
|
||||||
invalid_emails
|
invalid_emails
|
||||||
|
|
Loading…
Reference in New Issue