seunomosowon / TA-mailclient

This technology adapter add-on fetches emails for Splunk to index from mailboxes using either POP3 or IMAP, with or without SSL.
Apache License 2.0
9 stars 9 forks source link

KeyError: u'additional_folders' #20

Closed edro15 closed 3 years ago

edro15 commented 3 years ago

OS details

  Operating System: CentOS Linux 7 (Core)
  Kernel: Linux 3.10.0-1127.13.1.el7.x86_64
  Architecture: x86-64

Steps performed

By troubleshooting using Splunk UI and the suggested command (index=_internal sourcetype=splunkd (component=ModularInputs OR component=ExecProcessor) mail.py), I verify that the following error has been thrown:

12-28-2020 10:58:04.377 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py" Top level exception:  u'additional_folders'
12-28-2020 10:58:04.377 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py" Traceback (most recent call last):
12-28-2020 10:58:04.377 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py"   File "/opt/splunk/etc/apps/TA-mailclient/bin/mail.py", line 382, in stream_events
12-28-2020 10:58:04.378 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py"     self._stream_events(inputs, ew)
12-28-2020 10:58:04.378 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py"   File "/opt/splunk/etc/apps/TA-mailclient/bin/mail.py", line 408, in _stream_events
12-28-2020 10:58:04.378 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py"     self.additional_folders = input_item['additional_folders'].split(',')
12-28-2020 10:58:04.378 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-mailclient/bin/mail.py" KeyError: u'additional_folders'
seunomosowon commented 3 years ago

I have tested a fix for this, It's currently being tested for all v7.x, and v8.x. I'll upload it to splunkbase in a few minutes.

edro15 commented 3 years ago

Oh, I saw it while pushing the PR. :) I added a default value as well, to avoid other possible errors. Thanks for your work.

edro15 commented 3 years ago

@seunomosowon thanks. Fixed in PR #23