mirror of https://github.com/MISP/mail_to_misp
fix: Avoid failure if dns key is not in the config file.
parent
cbf0c07b67
commit
02b1c8ed96
|
@ -36,6 +36,8 @@ class Mail2MISP():
|
|||
if not self.offline:
|
||||
self.misp = PyMISP(misp_url, misp_key, verifycert, debug=config.debug)
|
||||
self.config = config
|
||||
if not hasattr(self.config, 'enable_dns'):
|
||||
setattr(self.config, 'enable_dns', True)
|
||||
self.debug = self.config.debug
|
||||
self.config_from_email_body = {}
|
||||
# Init Faup
|
||||
|
|
|
@ -60,6 +60,7 @@ class TestMailToMISP(unittest.TestCase):
|
|||
self.mail2misp.process_email_body()
|
||||
self.mail2misp.process_body_iocs()
|
||||
self.assertTrue('attachment' in [a.type for a in self.mail2misp.misp_event.attributes])
|
||||
self.assertTrue(self.mail2misp.misp_event.publish)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue