Skip to content

Commit

Permalink
clean msg_id
Browse files Browse the repository at this point in the history
  • Loading branch information
danielecalda committed Oct 24, 2023
1 parent d97647a commit 29a4f94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions email-parser/app/imap/util/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def parse_email(fetched_msg):
msg_from = msg['From']
msg_to = msg['To']
msg_cc = msg['Cc']
msg_id = msg.get('Message-ID')
msg_id = str(msg.get('Message-ID')).strip()

msg_date = email.utils.parsedate_tz(msg['Date'])
local_date = email.utils.mktime_tz(msg_date)
Expand All @@ -57,7 +57,6 @@ def parse_email(fetched_msg):
if msg.is_multipart():
for j, part in enumerate(msg.walk()):
content_type = part.get_content_type()
logger.info(content_type)
if content_type == 'text/html' or content_type == "text/plain":
charset = part.get_content_charset()
# decode the base64 unicode bytestring into plain text
Expand Down

0 comments on commit 29a4f94

Please sign in to comment.