Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE: Problem decoding email message: Expected list, got <class 'str'> #1015

Open
blockloop opened this issue Nov 22, 2024 · 19 comments
Open
Assignees
Labels
awaiting-feedback Waiting for feedback from the reporter investigating Investigating the issue

Comments

@blockloop
Copy link

blockloop commented Nov 22, 2024

Describe the bug
None of my Amazon packages are properly parsed. With debug logging I get the same error for every message found in the search

Environment (please complete the following information):

  • OS: HassOS
  • Type of device: Proxmox
  • Home Assistant version: latest
  • Component version: latest

Logs

2024-11-21 22:57:37.802 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "***REDACTED FOR GITHUB***.." has shipped!
2024-11-21 22:57:37.802 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Problem decoding email message: Expected list, got <class 'str'>
2024-11-21 22:57:37.806 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-11-21 22:57:37.806 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-11-21 22:57:37.806 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Amazon Subject: Now arriving today: Your Amazon package will be delivered today.
2024-11-21 22:57:37.806 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Problem decoding email message: Expected list, got <class 'str'>
2024-11-21 22:57:37.806 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] Amazon email search address: order-update@amazon.com
2024-11-21 22:57:37.806 DEBUG (SyncWorker_28) [custom_components.mail_and_packages.helpers] DEBUG subject: None

Additional Context

I also have USPS, UPS, and FedEx enabled and all of those work perfectly fine. This appears to be something specific to Amazon.

@blockloop blockloop added the pending Pending review label Nov 22, 2024
@firstof9 firstof9 added investigating Investigating the issue and removed pending Pending review labels Nov 22, 2024
@firstof9
Copy link
Collaborator

Try replacing the helpers.py in custom_components/mail_and_packages with this file:

https://raw.githubusercontent.com/firstof9/Home-Assistant-Mail-And-Packages/refs/heads/fix-1015/custom_components/mail_and_packages/helpers.py

Then restart HA and see if the errors go away and it starts working correctly.

@firstof9 firstof9 added the awaiting-feedback Waiting for feedback from the reporter label Nov 22, 2024
@blockloop
Copy link
Author

2024-11-22 21:30:55.766 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.mail_image_system_path for domain sensor with platform mail_and_packages
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 918, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1368, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 544, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mail_and_packages/sensor.py", line 200, in native_value
    path = self._config.data[CONF_PATH]
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'image_path'
2024-11-22 21:30:55.775 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.mail_image_url for domain sensor with platform mail_and_packages
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 918, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1368, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 544, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mail_and_packages/sensor.py", line 200, in native_value
    path = self._config.data[CONF_PATH]
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'image_path'
2024-11-22 21:30:55.830 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'Mail Delivery Notifications':
In 'condition':
  In 'or' (item 1 of 2):
    In 'template' condition: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ ((as_timestamp(now()) - as_timestamp(states.sensor.mail_usps_mail.last_changed)) < 15 and states('sensor.mail_usps_mail')|int > 0) }}' but no default was specified
  In 'or' (item 2 of 2):
    In 'template' condition: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ ((as_timestamp(now()) - as_timestamp(states.sensor.mail_packages_in_transit.last_changed)) < 15 and states('sensor.mail_packages_in_transit')|int > 0) }}' but no default was specified
2024-11-22 21:30:55.831 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'Mail Delivery Notifications':
In 'condition':
  In 'or' (item 1 of 2):
    In 'template' condition: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ ((as_timestamp(now()) - as_timestamp(states.sensor.mail_usps_mail.last_changed)) < 15 and states('sensor.mail_usps_mail')|int > 0) }}' but no default was specified
  In 'or' (item 2 of 2):
    In 'template' condition: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ ((as_timestamp(now()) - as_timestamp(states.sensor.mail_packages_in_transit.last_changed)) < 15 and states('sensor.mail_packages_in_transit')|int > 0) }}' but no default was specified

Now it doesn't work at all and I get this log dump. Not sure if this is helpful.

@firstof9
Copy link
Collaborator

Install the latest beta, then drop in that helpers.py.

@blockloop
Copy link
Author

The latest beta isn't working at all for me. Trying to connect to the server it fails to validate the SSL certificate even though I explicitly disabled checking:

2024-11-25 09:01:02.242 ERROR (MainThread) [custom_components.mail_and_packages.helpers] Error connecting into IMAP Server: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1000)

image

@firstof9
Copy link
Collaborator

@blockloop
Copy link
Author

blockloop commented Nov 29, 2024

Still got this:

2024-11-29 16:21:55.639 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Amazon emails found: 1
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order #111-1111111-1111111 has shipped
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Problem decoding email message: Expected list, got <class 'str'>
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Amazon order: ['111-1111111-1111111']
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Sensor: amazon_packages Count: 0
2024-11-29 16:21:55.646 DEBUG (SyncWorker_54) [custom_components.mail_and_packages.helpers] Attempting to find mail from (['donotreply_odd@dhl.com', 'NoReply.ODD@dhl.com', 'noreply@dhl.de', 'pl.no.reply@dhl.com', 'support@dhl.com']) with subject (DHL On Demand Delivery)

@firstof9
Copy link
Collaborator

@blockloop
Copy link
Author

Amazon Subject: Your Amazon.com order #111-1111111-1111111 has shipped
Problem decoding email message: Expected list, got <class 'str'>
Attempting alternative method.
Error updating sensor: amazon_packages reason: Expected list, got <class 'str'>

@blockloop
Copy link
Author

Are you trying to parse the email as multipart? Can you use msg.is_multipart()? I believe the message is not multipart which might be causing the issue.

@firstof9
Copy link
Collaborator

It's supposed to be multipart that's the problem.

@blockloop
Copy link
Author

blockloop commented Dec 1, 2024

What do you mean by "supposed to be multipart"? I thought IMAP could handle both single and multipart emails, with the MIME type determining the structure. Am I missing something?

(thanks for your help btw. I'm happy do provide more info if you need it)

@firstof9
Copy link
Collaborator

firstof9 commented Dec 3, 2024

@blockloop
Copy link
Author

Nice work. No error this time and the amazon sensor rightfully says "0." I'll order something soon and I'll let you know if it updates. Thanks

@blockloop
Copy link
Author

It doesn't appear to be picking up new packages but the original error seems to be gone.

@firstof9
Copy link
Collaborator

firstof9 commented Dec 5, 2024

Can you post debug log with sensitive info redacted?

@blockloop
Copy link
Author

There aren't any packages out for delivery yet. I'll let you know

@blockloop
Copy link
Author

2024-12-15 15:38:51.246 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon email list: ['amazon.com']
2024-12-15 15:38:51.246 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon email search address: ['shipment-tracking@amazon.com', 'conferma-spedizione@amazon.com', 'confirmar-envio@amazon.com', 'versandbestaetigung@amazon.com', 'confirmation-commande@amazon.com', 'verzending-volgen@amazon.com', 'update-bestelling@amazon.com']
2024-12-15 15:38:51.246 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] DEBUG subject: None
2024-12-15 15:38:51.246 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] DEBUG imap_search: (OR OR OR OR OR OR FROM "shipment-tracking@amazon.com" FROM "conferma-spedizione@amazon.com" FROM "confirmar-envio@amazon.com" FROM "versandbestaetigung@amazon.com" FROM "confirmation-commande@amazon.com" FROM "verzending-volgen@amazon.com" FROM "update-bestelling@amazon.com" SINCE 12-Dec-2024)
2024-12-15 15:38:52.590 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] email_search value: ('OK', [b'3085 3087 3089'])
2024-12-15 15:38:52.591 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon emails found: 3
2024-12-15 15:38:52.596 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-12-15 15:38:52.596 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-12-15 15:38:52.596 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "**REDACTED**" has shipped!
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arrivée :
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Verwachte bezorgdatum:
2024-12-15 15:38:52.598 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Votre date de livraison prévue est :
2024-12-15 15:38:52.604 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-12-15 15:38:52.604 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-12-15 15:38:52.604 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "**REDACTED**" has shipped!
2024-12-15 15:38:52.605 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2024-12-15 15:38:52.605 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2024-12-15 15:38:52.605 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2024-12-15 15:38:52.605 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arrivée :
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Verwachte bezorgdatum:
2024-12-15 15:38:52.606 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Votre date de livraison prévue est :
2024-12-15 15:38:52.612 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-12-15 15:38:52.612 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-12-15 15:38:52.612 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "**REDACTED**" has shipped!
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2024-12-15 15:38:52.614 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arrivée :
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Verwachte bezorgdatum:
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Votre date de livraison prévue est :
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Count: 0
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Attempting to find Amazon email with item list ...
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Processed forwards: []
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon email list: ['amazon.com']
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon email search address: ['shipment-tracking@amazon.com', 'conferma-spedizione@amazon.com', 'confirmar-envio@amazon.com', 'versandbestaetigung@amazon.com', 'confirmation-commande@amazon.com', 'verzending-volgen@amazon.com', 'update-bestelling@amazon.com']
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] DEBUG subject: None
2024-12-15 15:38:52.615 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] DEBUG imap_search: (OR OR OR OR OR OR FROM "shipment-tracking@amazon.com" FROM "conferma-spedizione@amazon.com" FROM "confirmar-envio@amazon.com" FROM "versandbestaetigung@amazon.com" FROM "confirmation-commande@amazon.com" FROM "verzending-volgen@amazon.com" FROM "update-bestelling@amazon.com" SINCE 12-Dec-2024)
2024-12-15 15:38:53.971 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] email_search value: ('OK', [b'3085 3087 3089'])
2024-12-15 15:38:53.971 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon emails found: 3
2024-12-15 15:38:53.977 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-12-15 15:38:53.977 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-12-15 15:38:53.977 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "**REDACTED**" has shipped!
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arrivée :
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Verwachte bezorgdatum:
2024-12-15 15:38:53.979 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Votre date de livraison prévue est :
2024-12-15 15:38:53.985 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-12-15 15:38:53.985 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-12-15 15:38:53.985 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "**REDACTED**" has shipped!
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2024-12-15 15:38:53.987 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2024-12-15 15:38:53.988 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2024-12-15 15:38:53.988 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arrivée :
2024-12-15 15:38:53.988 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Verwachte bezorgdatum:
2024-12-15 15:38:53.988 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Votre date de livraison prévue est :
2024-12-15 15:38:53.993 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Email Multipart: False
2024-12-15 15:38:53.993 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html
2024-12-15 15:38:53.993 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon Subject: Your Amazon.com order of "**REDACTED**" has shipped!
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: will arrive:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: estimated delivery date is:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: guaranteed delivery date is:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriving:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arriverà:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: arriving:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Dostawa:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Zustellung:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Entrega:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: A chegar:
2024-12-15 15:38:53.996 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Arrivée :
2024-12-15 15:38:53.997 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Verwachte bezorgdatum:
2024-12-15 15:38:53.997 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Looking for: Votre date de livraison prévue est :
2024-12-15 15:38:53.997 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Amazon order: ['111-1111111-1111111', '111-1111111-1111111', '111-1111111-1111111']
2024-12-15 15:38:53.997 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Sensor: amazon_packages Count: 0

I believe this is the relevant part. If it would help I could send you the HTML content of the email or I can run some code locally to test

@blockloop
Copy link
Author

I've done some debugging myself and for some reason this line is evaluating to True causing the continue. I dumped the entire message before the continue and I see the string 'will arrive' in the message HTML. I suspect there's an encoding issue or something

@firstof9
Copy link
Collaborator

2024-12-15 15:38:53.993 DEBUG (SyncWorker_24) [custom_components.mail_and_packages.helpers] Content Type: text/html

Your emails for some reason are missing the plain/text version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Waiting for feedback from the reporter investigating Investigating the issue
Projects
None yet
Development

No branches or pull requests

2 participants