Hi everyone,
I was just curious if it's possible to parse email header data from an email attachment without sending the email to the integration server. I wrote this quick script to parse the x-sender which works outside resilient, but when trying to run from the scripts tab under customization settings I'm running into issues (wrong object/variable being opened?):
import re
with open(attachment,'r') as f:
email = f.read()
if 'x-sender' in email:
pattern = re.compile('(?<=x-sender=")[^"]+')
result = pattern.search(email,0,5000)
log.info(result.group(0))
Console error output attached.
Thanks!
------------------------------
Jason Jemmott
Cyber Security Analyst
------------------------------