Skip to content

Commit 474467b

Browse files
wagner-intevationsebix
authored andcommitted
BUG: mail collectors: fix IMAP abort handling
the try-except block to handle aborted IMAP connections (timeout after a long processing of the message in IntelMQ) used the wrong class imaplib.abort does not exist, but the class is named imaplib.IMAP4.abort
1 parent e35edd7 commit 474467b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ CHANGELOG
3838
- Set the parent class of all bots to the correct bot class
3939

4040
#### Collectors
41-
- `intelmq.bots.collectors.mail._lib`: Add support for unverified SSL/STARTTLS connections (PR#2055 by Sebastian Wagner).
41+
- `intelmq.bots.collectors.mail._lib`:
42+
- Add support for unverified SSL/STARTTLS connections (PR#2055 by Sebastian Wagner).
43+
- Fix exception handling for aborted IMAP connections (PR#2187 by Sebastian Wagner).
4244
- `intelmq.bots.collectors.blueliv`: Fix Blueliv collector requirements (PR#2161 by Gethvi).
4345

4446
#### Parsers

intelmq/bots/collectors/mail/_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def process(self):
7676
if self.process_message(uid, message):
7777
try:
7878
mailbox.mark_seen(uid)
79-
except imaplib.abort:
79+
except imaplib.IMAP4.abort:
8080
# Disconnect, see https://github.com/certtools/intelmq/issues/852
8181
mailbox = self.connect_mailbox()
8282
mailbox.mark_seen(uid)

0 commit comments

Comments
 (0)