# Buggy code
def process(self):
    report = self.receive_message()

    if report is None or not report.contains("raw"):
        self.acknowledge_message()
        return

    raw_report = utils.base64_decode(report.value("raw"))

    fp = io.StringIO(raw_report)
    rows = csv.DictReader(fp)

    for row in rows:
        event = Event(report)

        for key, value in row.items():
            if not value:
                continue

            key = COLUMNS[key]

            if key == "__IGNORE__" or key == "__TDB__":
                continue

            if key == "source.fqdn" and IPAddress.is_valid(value, sanitize=True):
                continue

            if key == "time.source":
                value = value + " UTC"

            if key == "source.asn" and value.startswith("ASNA"):
                continue

            if key == "source.asn":
                for asn in value.split(","):
                    if asn.startswith("AS"):
                        value = asn.split("AS")[1]
                        break

            event.add(key, value, sanitize=True)

        event.add("classification.type", "malware")
        event.add("raw", ",".join(row), sanitize=True)

        self.send_message(event)
    self.acknowledge_message()


# Traceback (KeyError)
2015-09-19 01:19:12,339 - cleanmx-phishing-parser - ERROR - Bot has found a problem.
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/intelmq-1.0.0-py3.4.egg/intelmq/lib/bot.py", line 117, in start
self.process()
File "/usr/local/lib/python3.4/dist-packages/intelmq-1.0.0-py3.4.egg/intelmq/bots/parsers/cleanmx/parser_phishing.py", line 60, in process
key = COLUMNS[key]
KeyError: None
2015-09-19 01:19:12,564 - cleanmx-phishing-parser - INFO - Last Correct Message(event): None.
2015-09-19 01:19:12,653 - cleanmx-phishing-parser - INFO - Current Message(event): {'time.observation': '2015-09-19T00:19:11+00:00', 'feed.name': 'CleanMX', 'raw': 'ImxpbmUiLCJpZCIsImZpcnN0dGltZSIsImxhc3R0aW1lIiwicGhpc2h0YW5rIiwidmlydXNuYW1lIiwidXJsIiwicmVjZW50IiwicmVzcG9uc2UiLCJpcCIsInJldmlldyIsImRvbWFpbiIsImNvdW50cnkiLCJzb3VyY2UiLCJlbWFpbCIsImluZXRudW0iLCJuZXRuYW1lIiwiZGRlc2NyIiwibnMxIiwibnMyIiwibnMzIiwibnM0IiwibnM1IgoiMSIsIjY1MDUyODciLCIyMDE1LTA5LTE5IDAxOjM3OjI4IiwiMTk3MC0wMS0wMSAwMTowMDowMCIsIiIsIiIsImh0dHA6Ly92ZXJpdHlpbnRlbC5jb20vY3NzL3BheXBhbC9iZj

# Fixed code
def process(self):
    report = self.receive_message()

    if report is None or not report.contains("raw"):
        self.acknowledge_message()
        return

    raw_report = utils.base64_decode(report.value("raw"))

    fp = io.StringIO(raw_report)
    rows = csv.DictReader(fp)

    for row in rows:
        event = Event(report)

        for key, value in row.items():
            if not value:
                continue

            if key is None:
                self.logger.warning(
                    "Value without key found, skipping the value: {!r}".format(value)
                )
                continue

            key = COLUMNS[key]

            if key == "__IGNORE__" or key == "__TDB__":
                continue

            if key == "source.fqdn" and IPAddress.is_valid(value, sanitize=True):
                continue

            if key == "time.source":
                value = value + " UTC"

            if key == "source.asn" and value.startswith("ASNA"):
                continue

            if key == "source.asn":
                for asn in value.split(","):
                    if asn.startswith("AS"):
                        value = asn.split("AS")[1]
                        break

            event.add(key, value, sanitize=True)

        event.add("classification.type", "malware")
        event.add("raw", ",".join(row), sanitize=True)

        self.send_message(event)
    self.acknowledge_message()