Show also notice on account overview if account is ok.

This commit is contained in:
Martin Edenhofer 2015-09-06 13:39:16 +02:00
parent eb0aac89ba
commit a8d644af28
4 changed files with 35 additions and 35 deletions

View file

@ -65,12 +65,12 @@
<a href="#" data-type="delete" title="<%- @Ti('Delete') %>"><%- @Icon('trash') %></a>
</td>
</tr>
<% if channel.status_in is 'error': %>
<% if !_.isEmpty(channel.last_log_in): %>
<tr>
<td colspan="4"><%= channel.last_log_in %></td>
</tr>
<% end %>
<% if channel.status_out is 'error': %>
<% if !_.isEmpty(channel.last_log_out): %>
<tr>
<td colspan="4"><%= channel.last_log_out %></td>
</tr>

View file

@ -101,7 +101,7 @@ returns
break if content_max_check < content_messages
end
end
if content_messages >= content_messages
if content_messages >= content_max_check
content_messages = message_ids.count
end
disconnect
@ -123,15 +123,15 @@ returns
# check if verify message exists
subject = message_meta['ENVELOPE'].subject
if subject && subject =~ /#{verify_string}/
Rails.logger.info " - verify email #{verify_string} found"
@imap.store(message_id, '+FLAGS', [:Deleted])
@imap.expunge()
disconnect
return {
result: 'ok',
}
end
next if !subject
next if subject !~ /#{verify_string}/
Rails.logger.info " - verify email #{verify_string} found"
@imap.store(message_id, '+FLAGS', [:Deleted])
@imap.expunge()
disconnect
return {
result: 'ok',
}
end
disconnect
@ -153,10 +153,10 @@ returns
message_meta = @imap.fetch(message_id, ['RFC822.SIZE', 'FLAGS', 'INTERNALDATE'])[0]
# 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
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
notice += "#{info}\n"
next
@ -170,6 +170,7 @@ returns
# delete email from server after article was created
msg = @imap.fetch(message_id, 'RFC822')[0].attr['RFC822']
next if !msg
if process(channel, msg)
@imap.store(message_id, '+FLAGS', [:Deleted])
count_fetched += 1

View file

@ -88,7 +88,7 @@ returns
break if content_max_check < content_messages
end
end
if content_messages >= content_messages
if content_messages >= content_max_check
content_messages = mails.count
end
disconnect
@ -109,14 +109,13 @@ returns
next if !mail
# check if verify message exists
if mail =~ /#{verify_string}/
Rails.logger.info " - verify email #{verify_string} found"
m.delete
disconnect
return {
result: 'ok',
}
end
next if mail !~ /#{verify_string}/
Rails.logger.info " - verify email #{verify_string} found"
m.delete
disconnect
return {
result: 'ok',
}
end
return {
@ -132,14 +131,14 @@ returns
mails.each do |m|
count += 1
Rails.logger.info " - message #{count}/#{count_all}"
mail = m.pop
next if !mail
# 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
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
notice += "#{info}\n"
next

View file

@ -72,15 +72,15 @@ returns on fail
next if domain_to_check !~ /#{settings[:domain]}/i
# 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])
Rails.logger.info "INBOUND RESULT PROVIDER: #{result_inbound.inspect}"
Rails.logger.debug "INBOUND RESULT PROVIDER: #{result_inbound.inspect}"
next if result_inbound[:result] != 'ok'
# 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])
Rails.logger.info "OUTBOUND RESULT PROVIDER: #{result_outbound.inspect}"
Rails.logger.debug "OUTBOUND RESULT PROVIDER: #{result_outbound.inspect}"
next if result_outbound[:result] != 'ok'
return {
@ -103,9 +103,9 @@ returns on fail
}
success = false
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)
Rails.logger.info "INBOUND RESULT GUESS: #{result_inbound.inspect}"
Rails.logger.debug "INBOUND RESULT GUESS: #{result_inbound.inspect}"
next if result_inbound[:result] != 'ok'
@ -131,9 +131,9 @@ returns on fail
success = false
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])
Rails.logger.info "OUTBOUND RESULT GUESS: #{result_outbound.inspect}"
Rails.logger.debug "OUTBOUND RESULT GUESS: #{result_outbound.inspect}"
next if result_outbound[:result] != 'ok'
@ -149,7 +149,7 @@ returns on fail
reason: 'outbound failed',
}
end
Rails.logger.info "PROBE FULL SUCCESS: #{result.inspect}"
result
end