Select message data in the imap event (#32212)

* Select message data in the imap event

* Mention imap.fetch

* Add note for headers and text

* Tiny style tweaks

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Luca Angemi 2024-04-09 11:19:04 +02:00 committed by GitHub
parent ee47d44219
commit cea575916a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,6 +68,12 @@ Yahoo also requires the character set `US-ASCII`.
</div>
### Selecting message data to include in the IMAP event (advanced mode)
By default, the IMAP event won't include `text` or `headers` message data. If you want them to be included (`text` or `headers`, or both), you have to manually select them in the option flow.
Another way to process the `text` data, is to use the `imap.fetch` service. In this case, `text` won't be limited by size.
### Selecting an alternate SSL cipher list or disabling SSL verification (advanced mode)
If the default IMAP server settings do not work, you might try to set an alternate SSL cipher list.
@ -120,7 +126,7 @@ search:
folder:
description: The IMAP folder configuration
text:
description: The email body `text` of the message. By default, only the first 2048 bytes of the body text will be available, the rest will be clipped off. You can increase the maximum text size of the body, but this is not advised and will never guarantee that the whole message text is available. A better practice is using a custom event data template (advanced settings) that can be used to parse the whole message, not limited by size. The rendered result will then be added as attribute `custom` to the event data to be used for automations.
description: The email body `text` of the message. By default, only the first 2048 bytes of the body text will be available, the rest will be clipped off. You can increase the maximum text size of the body, but this is not advised and will never guarantee that the whole message text is available. A better practice is using a custom event data template (advanced settings) that can be used to parse the whole message, not limited by size. The rendered result will then be added as attribute `custom` to the event data to be used for automations. `text` will be included if it is explicitly selected in the option flow.
sender:
description: The `sender` of the message
subject:
@ -128,7 +134,7 @@ subject:
date:
description: A `datetime` object of the `date` sent
headers:
description: The `headers` of the message in the for of a dictionary. The values are iterable as headers can occur more than once.
description: The `headers` of the message in the for of a dictionary. The values are iterable as headers can occur more than once. `headers` will be included if it is explicitly selected in the option flow.
custom:
description: Holds the result of the custom event data [template](/docs/configuration/templating). All attributes are available as a variable in the template.
initial: