Show also notice on account overview if account is ok.
This commit is contained in:
parent
eb0aac89ba
commit
a8d644af28
4 changed files with 35 additions and 35 deletions
|
@ -65,12 +65,12 @@
|
||||||
<a href="#" data-type="delete" title="<%- @Ti('Delete') %>"><%- @Icon('trash') %></a>
|
<a href="#" data-type="delete" title="<%- @Ti('Delete') %>"><%- @Icon('trash') %></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% if channel.status_in is 'error': %>
|
<% if !_.isEmpty(channel.last_log_in): %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4"><%= channel.last_log_in %></td>
|
<td colspan="4"><%= channel.last_log_in %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if channel.status_out is 'error': %>
|
<% if !_.isEmpty(channel.last_log_out): %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4"><%= channel.last_log_out %></td>
|
<td colspan="4"><%= channel.last_log_out %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -101,7 +101,7 @@ returns
|
||||||
break if content_max_check < content_messages
|
break if content_max_check < content_messages
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if content_messages >= content_messages
|
if content_messages >= content_max_check
|
||||||
content_messages = message_ids.count
|
content_messages = message_ids.count
|
||||||
end
|
end
|
||||||
disconnect
|
disconnect
|
||||||
|
@ -123,15 +123,15 @@ returns
|
||||||
|
|
||||||
# check if verify message exists
|
# check if verify message exists
|
||||||
subject = message_meta['ENVELOPE'].subject
|
subject = message_meta['ENVELOPE'].subject
|
||||||
if subject && subject =~ /#{verify_string}/
|
next if !subject
|
||||||
Rails.logger.info " - verify email #{verify_string} found"
|
next if subject !~ /#{verify_string}/
|
||||||
@imap.store(message_id, '+FLAGS', [:Deleted])
|
Rails.logger.info " - verify email #{verify_string} found"
|
||||||
@imap.expunge()
|
@imap.store(message_id, '+FLAGS', [:Deleted])
|
||||||
disconnect
|
@imap.expunge()
|
||||||
return {
|
disconnect
|
||||||
result: 'ok',
|
return {
|
||||||
}
|
result: 'ok',
|
||||||
end
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
disconnect
|
disconnect
|
||||||
|
@ -153,10 +153,10 @@ returns
|
||||||
message_meta = @imap.fetch(message_id, ['RFC822.SIZE', 'FLAGS', 'INTERNALDATE'])[0]
|
message_meta = @imap.fetch(message_id, ['RFC822.SIZE', 'FLAGS', 'INTERNALDATE'])[0]
|
||||||
|
|
||||||
# ignore to big messages
|
# ignore to big messages
|
||||||
max_message_size = Setting.get('postmaster_max_size')
|
max_message_size = Setting.get('postmaster_max_size').to_f
|
||||||
real_message_size = message_meta.attr['RFC822.SIZE'].to_f / 1024 / 1024
|
real_message_size = message_meta.attr['RFC822.SIZE'].to_f / 1024 / 1024
|
||||||
if real_message_size > max_message_size
|
if real_message_size > max_message_size
|
||||||
info = " - ignore message #{count}/#{count_all} - because message is to big (is:#{real_message_size}/max:#{max_message_size} in MB)"
|
info = " - ignore message #{count}/#{count_all} - because message is to big (is:#{real_message_size} MB/max:#{max_message_size} MB)"
|
||||||
Rails.logger.info info
|
Rails.logger.info info
|
||||||
notice += "#{info}\n"
|
notice += "#{info}\n"
|
||||||
next
|
next
|
||||||
|
@ -170,6 +170,7 @@ returns
|
||||||
|
|
||||||
# delete email from server after article was created
|
# delete email from server after article was created
|
||||||
msg = @imap.fetch(message_id, 'RFC822')[0].attr['RFC822']
|
msg = @imap.fetch(message_id, 'RFC822')[0].attr['RFC822']
|
||||||
|
next if !msg
|
||||||
if process(channel, msg)
|
if process(channel, msg)
|
||||||
@imap.store(message_id, '+FLAGS', [:Deleted])
|
@imap.store(message_id, '+FLAGS', [:Deleted])
|
||||||
count_fetched += 1
|
count_fetched += 1
|
||||||
|
|
|
@ -88,7 +88,7 @@ returns
|
||||||
break if content_max_check < content_messages
|
break if content_max_check < content_messages
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if content_messages >= content_messages
|
if content_messages >= content_max_check
|
||||||
content_messages = mails.count
|
content_messages = mails.count
|
||||||
end
|
end
|
||||||
disconnect
|
disconnect
|
||||||
|
@ -109,14 +109,13 @@ returns
|
||||||
next if !mail
|
next if !mail
|
||||||
|
|
||||||
# check if verify message exists
|
# check if verify message exists
|
||||||
if mail =~ /#{verify_string}/
|
next if mail !~ /#{verify_string}/
|
||||||
Rails.logger.info " - verify email #{verify_string} found"
|
Rails.logger.info " - verify email #{verify_string} found"
|
||||||
m.delete
|
m.delete
|
||||||
disconnect
|
disconnect
|
||||||
return {
|
return {
|
||||||
result: 'ok',
|
result: 'ok',
|
||||||
}
|
}
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -132,14 +131,14 @@ returns
|
||||||
mails.each do |m|
|
mails.each do |m|
|
||||||
count += 1
|
count += 1
|
||||||
Rails.logger.info " - message #{count}/#{count_all}"
|
Rails.logger.info " - message #{count}/#{count_all}"
|
||||||
|
|
||||||
mail = m.pop
|
mail = m.pop
|
||||||
|
next if !mail
|
||||||
|
|
||||||
# ignore to big messages
|
# ignore to big messages
|
||||||
max_message_size = Setting.get('postmaster_max_size')
|
max_message_size = Setting.get('postmaster_max_size').to_f
|
||||||
real_message_size = mail.size.to_f / 1024 / 1024
|
real_message_size = mail.size.to_f / 1024 / 1024
|
||||||
if real_message_size > max_message_size
|
if real_message_size > max_message_size
|
||||||
info = " - ignore message #{count}/#{count_all} - because message is to big (is:#{real_message_size}/max:#{max_message_size} in MB)"
|
info = " - ignore message #{count}/#{count_all} - because message is to big (is:#{real_message_size} MB/max:#{max_message_size} MB)"
|
||||||
Rails.logger.info info
|
Rails.logger.info info
|
||||||
notice += "#{info}\n"
|
notice += "#{info}\n"
|
||||||
next
|
next
|
||||||
|
|
|
@ -72,15 +72,15 @@ returns on fail
|
||||||
next if domain_to_check !~ /#{settings[:domain]}/i
|
next if domain_to_check !~ /#{settings[:domain]}/i
|
||||||
|
|
||||||
# probe inbound
|
# probe inbound
|
||||||
Rails.logger.info "INBOUND PROBE PROVIDER: #{settings[:inbound].inspect}"
|
Rails.logger.debug "INBOUND PROBE PROVIDER: #{settings[:inbound].inspect}"
|
||||||
result_inbound = EmailHelper::Probe.inbound(settings[:inbound])
|
result_inbound = EmailHelper::Probe.inbound(settings[:inbound])
|
||||||
Rails.logger.info "INBOUND RESULT PROVIDER: #{result_inbound.inspect}"
|
Rails.logger.debug "INBOUND RESULT PROVIDER: #{result_inbound.inspect}"
|
||||||
next if result_inbound[:result] != 'ok'
|
next if result_inbound[:result] != 'ok'
|
||||||
|
|
||||||
# probe outbound
|
# probe outbound
|
||||||
Rails.logger.info "OUTBOUND PROBE PROVIDER: #{settings[:outbound].inspect}"
|
Rails.logger.debug "OUTBOUND PROBE PROVIDER: #{settings[:outbound].inspect}"
|
||||||
result_outbound = EmailHelper::Probe.outbound(settings[:outbound], params[:email])
|
result_outbound = EmailHelper::Probe.outbound(settings[:outbound], params[:email])
|
||||||
Rails.logger.info "OUTBOUND RESULT PROVIDER: #{result_outbound.inspect}"
|
Rails.logger.debug "OUTBOUND RESULT PROVIDER: #{result_outbound.inspect}"
|
||||||
next if result_outbound[:result] != 'ok'
|
next if result_outbound[:result] != 'ok'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -103,9 +103,9 @@ returns on fail
|
||||||
}
|
}
|
||||||
success = false
|
success = false
|
||||||
inbound_map.each {|config|
|
inbound_map.each {|config|
|
||||||
Rails.logger.info "INBOUND PROBE GUESS: #{config.inspect}"
|
Rails.logger.debug "INBOUND PROBE GUESS: #{config.inspect}"
|
||||||
result_inbound = EmailHelper::Probe.inbound(config)
|
result_inbound = EmailHelper::Probe.inbound(config)
|
||||||
Rails.logger.info "INBOUND RESULT GUESS: #{result_inbound.inspect}"
|
Rails.logger.debug "INBOUND RESULT GUESS: #{result_inbound.inspect}"
|
||||||
|
|
||||||
next if result_inbound[:result] != 'ok'
|
next if result_inbound[:result] != 'ok'
|
||||||
|
|
||||||
|
@ -131,9 +131,9 @@ returns on fail
|
||||||
|
|
||||||
success = false
|
success = false
|
||||||
outbound_map.each {|config|
|
outbound_map.each {|config|
|
||||||
Rails.logger.info "OUTBOUND PROBE GUESS: #{config.inspect}"
|
Rails.logger.debug "OUTBOUND PROBE GUESS: #{config.inspect}"
|
||||||
result_outbound = EmailHelper::Probe.outbound(config, params[:email])
|
result_outbound = EmailHelper::Probe.outbound(config, params[:email])
|
||||||
Rails.logger.info "OUTBOUND RESULT GUESS: #{result_outbound.inspect}"
|
Rails.logger.debug "OUTBOUND RESULT GUESS: #{result_outbound.inspect}"
|
||||||
|
|
||||||
next if result_outbound[:result] != 'ok'
|
next if result_outbound[:result] != 'ok'
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ returns on fail
|
||||||
reason: 'outbound failed',
|
reason: 'outbound failed',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Rails.logger.info "PROBE FULL SUCCESS: #{result.inspect}"
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue