Skip to content

Commit

Permalink
fix junkmail logic
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Nov 1, 2022
1 parent 1d789a0 commit 0a91fdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/mail_and_packages/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,8 @@ def get_mails(
elif part.get_content_type() == "image/jpeg":
_LOGGER.debug("Extracting image from email")
filename = part.get_filename()
if ["mailer", "content"] in filename:
junkmail = ["mailer", "content"]
if any(junk in filename for junk in junkmail):
_LOGGER.debug("Discarding junk mail.")
continue
try:
Expand Down

0 comments on commit 0a91fdc

Please sign in to comment.