Documentation for Exposing IMAP Search String (#8034)

* Documentation for Exposing IMAP Search String

To accompany a PR to sensor/imap.py

* Rewrote Last Sentence for More Clarity
This commit is contained in:
Matthew Wegner 2019-01-21 15:00:22 -07:00 committed by Franck Nijhof
parent a8cd28c5cf
commit 6bc6467b0f

View File

@ -57,4 +57,18 @@ folder:
required: false required: false
default: inbox default: inbox
type: string type: string
search:
description: The IMAP search to perform on the watched folder.
required: false
default: UnSeen UnDeleted
type: string
{% endconfiguration %} {% endconfiguration %}
### {% linkable_title Configuring IMAP Searches %}
By default, this component will count unread emails. By configuring the search string, you can count other results, for example:
* `ALL` to count all emails in a folder
* `FROM`, `TO`, `SUBJECT` to find emails in a folder (see [IMAP RFC for all standard options](https://tools.ietf.org/html/rfc3501#section-6.4.4))
* [Gmail's IMAP extensions](https://developers.google.com/gmail/imap/imap-extensions) allow raw Gmail searches, like `X-GM-RAW "in: inbox older_than:7d"` to show emails older than one week in your inbox. Note that raw Gmail searches will ignore your folder configuration and search all emails in your account!