Follow up - 045902351 - fixes #2754

045902351 adds a `rescue` clause
to fix a bug in which IMAP parsing errors
cause the entire email import process to fail.[0]

This bugfix contains an error:
we're still not sure why,
but the `next` inside the `rescue` clause
does not act like the `next`s outside of it
(execution of the containing `.each` block continues,
even after passing `next`).

This commit puts `next` in the right place,
so that the method will skip processing of the current message
and move onto the next one.

[0]: https://github.com/zammad/zammad/issues/2754
This commit is contained in:
Ryan Lue 2019-12-17 09:47:15 +01:00 committed by Thorsten Eckel
parent 5f861c566d
commit 7a7ab6a95a

View file

@ -234,9 +234,10 @@ example
NOTICE
Rails.logger.error "Net::IMAP failed to parse message #{message_id}: #{e.message} (#{e.class})"
Rails.logger.error '(See https://github.com/zammad/zammad/issues/2754 for more details)'
next
end
next if message_meta.nil?
# ignore verify messages
next if !messages_is_too_old_verify?(message_meta, count, count_all)