UNIT777 / Email2TheHive

This package allows for creating alerts in The Hive from emails retrieved from a Microsoft Exchange mailbox.
12 stars 3 forks source link

AttributeError #1

Open TechBurn0ut opened 7 years ago

TechBurn0ut commented 7 years ago

Get the following error when it is enumerating emails in the 'to_be_processed' folder.

Error:

---------------------Scraping through to_be_processed folder----------------- Traceback (most recent call last): File "./email2hive.py", line 51, in date_received = match.group(0).replace("Date:", '').strip() AttributeError: 'tuple' object has no attribute 'group'

TechBurn0ut commented 7 years ago

The above error was a syntax error on the line: match = re.search('Sent:<\/b>[^<]*', item.body),

I now get this error: ---------------------Scraping through to_be_processed folder----------------- Traceback (most recent call last): File "./email2hive.py", line 53, in date_received = match.group(0).replace("Sent:", '').strip() AttributeError: 'NoneType' object has no attribute 'group'

BrevilleBro commented 7 years ago

Hi @TechBurn0ut,

Thanks for getting in contact with us and sorry for the slow response.

Those are all RegEx rules that we used to match and extract certain fields from the emails we are parsing. I recommend tailoring these to the emails you are trying to scrape.

In the future, we intend to make this more 'modular' to allow you to choose what to filter. However, for now it will be up to you or someone in your team to customise that portion of the code to suit your environment.

If you need any more help, let me know :)