From 7a7ab6a95aef12bc15a23536ad82c7a087e9c860 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Tue, 17 Dec 2019 09:47:15 +0100 Subject: [PATCH] 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 --- app/models/channel/driver/imap.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/channel/driver/imap.rb b/app/models/channel/driver/imap.rb index af67bf76b..abe238500 100644 --- a/app/models/channel/driver/imap.rb +++ b/app/models/channel/driver/imap.rb @@ -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)