Small improvements.

This commit is contained in:
Martin Edenhofer 2015-08-23 23:06:21 +02:00
parent f1a42dfee9
commit 0be6838909
2 changed files with 5 additions and 4 deletions

View file

@ -72,11 +72,11 @@ returns on fail
# probe inbound
result = EmailHelper::Probe.inbound(settings[:inbound])
next if result[:result] != 'ok'
return result if result[:result] != 'ok'
# probe outbound
result = EmailHelper::Probe.outbound(settings[:outbound], params[:email])
next if result[:result] != 'ok'
return result if result[:result] != 'ok'
result = {
result: 'ok',
@ -365,6 +365,7 @@ returns on fail
'Lookup failed' => 'Authentication failed, username incorrect!',
'Invalid credentials' => 'Authentication failed, invalid credentials!',
'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!',
'execution expired' => 'Host not reachable!',
'Connection refused' => 'Connection refused!',

View file

@ -77,12 +77,12 @@ or
found = Channel::Pop3.new.fetch( { options: params[:inbound][:options] }, 'verify', subject )
end
rescue => e
render json: {
rresult {
result: 'invalid',
message: e.to_s,
subject: subject,
}
return
return result
end
next if !found