From 6bc6467b0fc9ea2cbd070aeff008defad51b1842 Mon Sep 17 00:00:00 2001 From: Matthew Wegner Date: Mon, 21 Jan 2019 15:00:22 -0700 Subject: [PATCH] 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 --- source/_components/sensor.imap.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/_components/sensor.imap.markdown b/source/_components/sensor.imap.markdown index 27ae8f63c78..e993ffbd0fd 100644 --- a/source/_components/sensor.imap.markdown +++ b/source/_components/sensor.imap.markdown @@ -57,4 +57,18 @@ folder: required: false default: inbox type: string +search: + description: The IMAP search to perform on the watched folder. + required: false + default: UnSeen UnDeleted + type: string {% 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! +