Skip to content

Commit dfdd9bb

Browse files
committed
mail attachment: Remove deprecated parameter attach_unzip
Remove deprecated parameter `attach_unzip` from default parameters so that IntelMQ Manager does not propose it for new bots instead use getattr/hasattr in the code
1 parent dba94eb commit dfdd9bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- Fixed timezone issue for collecting reports.
2626
- `intelmq.bots.collectors.shodan.collector_stream` (PR#2492 by Mikk Margus Möll):
2727
- Add `alert` parameter to Shodan stream collector to allow fetching streams by configured alert ID
28+
- `intelmq.bots.collectors.mail._lib`: Remove deprecated parameter `attach_unzip` from default parameters (PR#2511 by Sebastian Wagner).
2829

2930
#### Parsers
3031
- `intelmq.bots.parsers.shadowserver._config`:

intelmq/bots/collectors/mail/_lib.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818

1919
class MailCollectorBot(CollectorBot):
20-
attach_unzip = None
2120
mail_host = None
2221
ssl_ca_certificate = None
2322
mail_user = None
@@ -35,8 +34,8 @@ def init(self):
3534
if imbox is None:
3635
raise MissingDependencyError("imbox")
3736

38-
if self.attach_unzip is not None and not self.extract_files:
39-
self.extract_files = True
37+
if getattr(self, 'attach_unzip', None) is not None and hasattr(self, 'extract_files'):
38+
setattr(self, 'extract_files', True)
4039
self.logger.warning("The parameter 'attach_unzip' is deprecated and will "
4140
"be removed in version 4.0. Use 'extract_files' instead.")
4241

0 commit comments

Comments
 (0)