home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.16k stars 29.83k forks source link

Unknown MIME Type in SMTP only when fired from automation #49216

Closed majkers closed 3 years ago

majkers commented 3 years ago

The problem

When I try to send image via email with STMP from my automation I get an error but running the same for developer's tools works well.

What is version of Home Assistant Core has the issue?

2021.4.4

What was the last working version of Home Assistant Core?

Unknown

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SMTP

Link to integration documentation on our website

https://www.home-assistant.io/integrations/smtp

Example YAML snippet

- alias: 'Wyslij info z osobami z frontu'
  trigger:
    - event_type: folder_watcher
      platform: event
      event_data:
        event_type: modified
        path: '/config/www/image_processing/rekognition_kamera_home1_latest.jpg'  
  action:
  - service: notify.notify_email
    data:
        title: 'Wykryto osoby na zewnatrz'
        message: 'Wykryte osoby'
        data:
          images:
              - '/config/www/image_processing/rekognition_kamera_home1_latest.jpg'

Anything in the logs that might be useful for us?

Attachment /config/www/image_processing/rekognition_kamera_home1_latest.jpg has an unknown MIME type. Falling back to file
probot-home-assistant[bot] commented 3 years ago

Hey there @fabaff, mind taking a look at this issue as its been labeled with an integration (smtp) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

majkers commented 3 years ago

This is part of email message send via automatio (not working) <p>Wykryte osoby</p><br><img src="cid:image0"><br> --===============1525122470==-- --===============0753754475== Content-Type: image/jpeg MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-ID: <image0>

and this is the same automation's part responsible for sending an email run by developers tools:

<p>Wykryte osoby</p><br><img src="cid:image0"><br> --===============0966636468==-- --===============1450530006== Content-Type: application/octet-stream; Name="/config/www/image_processing/rekognition_kamera_home1_latest.jpg" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="/config/www/image_processing/rekognition_kamera_home1_latest.jpg" Content-ID: <image0>

majkers commented 3 years ago

Funny part. That automation also sends the same image as part of notification on HA mobile app and it working there without any problems. There must be something with sending emails.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.