Info about Gmail App Password and X-GM-RAW example (#15274)

Co-authored-by: Franck Nijhof <frenck@frenck.dev>
This commit is contained in:
Tobias Nordahl Kristensen 2020-10-17 12:30:22 +02:00 committed by GitHub
parent 716d32f2c7
commit 44ff153609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,17 @@ charset:
type: string
{% endconfiguration %}
### Gmail with App Password
If youre going to use Gmail, its always good practice to create a [App Password](https://support.google.com/mail/answer/185833?hl=en).
1. Go to your [Google Account](https://myaccount.google.com/)
2. Select **Security**
3. Under “Signing in to Google” select **App Passwords**
4. Sign in to your Account, and create a new App Password for Gmail.
You can now use this as your password for Gmail, in your configuration.
### Configuring IMAP Searches
By default, this integration will count unread emails. By configuring the search string, you can count other results, for example:
@ -81,6 +92,8 @@ sensor:
username: YOUR_USERNAME
password: YOUR_PASSWORD
search: FROM <sender@email.com>, SUBJECT <subject here>
# Or use X-GM-RAW search-term like this, to find unread emails from the last 7 days in your inbox
# search: "X-GM-RAW 'in: inbox newer_than:7d is:unread'"
# Example configuration.yaml entry for Office 365
sensor: