diff --git a/custom_components/mail_and_packages/helpers.py b/custom_components/mail_and_packages/helpers.py index dc94accf..06bbe974 100644 --- a/custom_components/mail_and_packages/helpers.py +++ b/custom_components/mail_and_packages/helpers.py @@ -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: