Skip to content

Commit

Permalink
mail attachment: Remove deprecated parameter attach_unzip
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sebix committed Jul 8, 2024
1 parent dba94eb commit dfdd9bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Fixed timezone issue for collecting reports.
- `intelmq.bots.collectors.shodan.collector_stream` (PR#2492 by Mikk Margus Möll):
- Add `alert` parameter to Shodan stream collector to allow fetching streams by configured alert ID
- `intelmq.bots.collectors.mail._lib`: Remove deprecated parameter `attach_unzip` from default parameters (PR#2511 by Sebastian Wagner).

#### Parsers
- `intelmq.bots.parsers.shadowserver._config`:
Expand Down
5 changes: 2 additions & 3 deletions intelmq/bots/collectors/mail/_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class MailCollectorBot(CollectorBot):
attach_unzip = None
mail_host = None
ssl_ca_certificate = None
mail_user = None
Expand All @@ -35,8 +34,8 @@ def init(self):
if imbox is None:
raise MissingDependencyError("imbox")

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

Expand Down

0 comments on commit dfdd9bb

Please sign in to comment.