Skip to content

Commit

Permalink
e-mail content check
Browse files Browse the repository at this point in the history
  • Loading branch information
gassc committed Apr 17, 2018
1 parent 224ce4e commit 9116fbe
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/get_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,18 @@ def retrieve(self):

result, data = server.uid(
'fetch', str(uid), '(RFC822)') # fetch entire message
msg = email.message_from_string(data[0][1].decode())
if data and data[0]:
msg = email.message_from_string(data[0][1].decode())

# parse the email here:
mail = self._get_first_text_block(msg)
# parse the email here:
mail = self._get_first_text_block(msg)

# log.info(text)
# parse_email.go(text.split("\n"))
self.mails.append(mail)
# log.info(text)
# parse_email.go(text.split("\n"))
self.mails.append(mail)

# record the uid in the db here
# append_uids_to_log([uid])
# record the uid in the db here
# append_uids_to_log([uid])

server.logout()

Expand Down

0 comments on commit 9116fbe

Please sign in to comment.