Small improvements.
This commit is contained in:
parent
f1a42dfee9
commit
0be6838909
2 changed files with 5 additions and 4 deletions
|
@ -72,11 +72,11 @@ returns on fail
|
||||||
|
|
||||||
# probe inbound
|
# probe inbound
|
||||||
result = EmailHelper::Probe.inbound(settings[:inbound])
|
result = EmailHelper::Probe.inbound(settings[:inbound])
|
||||||
next if result[:result] != 'ok'
|
return result if result[:result] != 'ok'
|
||||||
|
|
||||||
# probe outbound
|
# probe outbound
|
||||||
result = EmailHelper::Probe.outbound(settings[:outbound], params[:email])
|
result = EmailHelper::Probe.outbound(settings[:outbound], params[:email])
|
||||||
next if result[:result] != 'ok'
|
return result if result[:result] != 'ok'
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
result: 'ok',
|
result: 'ok',
|
||||||
|
@ -365,6 +365,7 @@ returns on fail
|
||||||
'Lookup failed' => 'Authentication failed, username incorrect!',
|
'Lookup failed' => 'Authentication failed, username incorrect!',
|
||||||
'Invalid credentials' => 'Authentication failed, invalid credentials!',
|
'Invalid credentials' => 'Authentication failed, invalid credentials!',
|
||||||
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
|
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
|
||||||
|
'getaddrinfo: Name or service not known' => 'Hostname not found!',
|
||||||
'No route to host' => 'No route to host!',
|
'No route to host' => 'No route to host!',
|
||||||
'execution expired' => 'Host not reachable!',
|
'execution expired' => 'Host not reachable!',
|
||||||
'Connection refused' => 'Connection refused!',
|
'Connection refused' => 'Connection refused!',
|
||||||
|
|
|
@ -77,12 +77,12 @@ or
|
||||||
found = Channel::Pop3.new.fetch( { options: params[:inbound][:options] }, 'verify', subject )
|
found = Channel::Pop3.new.fetch( { options: params[:inbound][:options] }, 'verify', subject )
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
render json: {
|
rresult {
|
||||||
result: 'invalid',
|
result: 'invalid',
|
||||||
message: e.to_s,
|
message: e.to_s,
|
||||||
subject: subject,
|
subject: subject,
|
||||||
}
|
}
|
||||||
return
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
next if !found
|
next if !found
|
||||||
|
|
Loading…
Reference in a new issue