Rainmeter Samurize utilities forum

Rainmeter
plugins
& mods

Plugins / mods for the Rainmeter desktop widget app

Universal email checker

Skin with subject user time

This plugin can check new email on several mailserver types: POP, IMAP, Gmail Atom and Protonmail. it can retrieve the subject, sender and the arrival time.

OAuth2

Gmail and Office 365 now enforce OAuth2. The user now has to either 1) activate 2FA in their Google account and set up an app password, or 2) get an OAuth2 token for a specifc app (2FA is then not needed). The download links (bottom) include a command-line exe that gets a Google OAuth2 token for this plugin. It will launch a consent form where you log into Google and approve this app. You'll get safety warnings, they just mean you're letting this plugin access your emails. The app will print out your token. You can save it and use as the account password. To simplify things, if the password is >32 chars long, it's treated as an OAuth2 token and you'll log in with OAuth2.

Gmail OAuth2 overview
Office 365 OAuth2 overview

Instructions

In a plugin measure, create a set of parameters for each of your email accounts , with a number at the end identifying the account (0-8).

[msGmail]
Measure=Plugin
Plugin=EmailCheckerSimple
; --- 1st email account
Name0=Gmail
ServerType0=GmailAtom
Username0=[username]
PasswordFile0=[yourpasswordfile]
; --- 2nd email account
Name1=Domain
ServerType1=POP
...
Numbered account settings (#: 0-8)

ServerType#

IMAP, POP, GmailAtom, GmailPop (OAuth2)

ServerAddress#

Your mailserver e.g. pop.aol.com

PasswordFile#

Instead of specifying the password openly as Password=, you can point PasswordFile= to a file containing the password, stored in a secure location

Password#

Specify the password directy in the skin. Be careful, if you're not the only one with access to the PC. If the password is > 32 chars long, it's treated as an OAuth2 token and you'll log in with OAuth2

Active#

Turn on/off email checking for this server

Port#

(Optional) If your server requires a specific port

Security#
protocol

(Optional) NONE, AUTO, SSL, STARTTLS

TLS#

(TLS version, not needed in Net >=4.7) 12 (TLS1.2) or 11 (TLS1.1)

Authentication#

(Optional) CRAMMD5, DIGESTMD5, LOGIN, NATIVE, PLAIN, APOP

IgnoreBadCert#

(Optional) if you're using Proton Bridge for Protonmail, you need to disable the cert. check. This is because Proton's security certificate is for a domain, not an IP, as is the case with the Bridge (127.0.0.1)
General plugin settings

Delay
(seconds)

When Rainmeter first starts, wait this long before the first email check. Useful if you need time to unlock your passwords location, etc

MaxSubjectLength

Shorten subject line to this many characters

Ellipsis

Mark the end of a trimmed subject with these characters

MaxFromLength

Shorten any from-related info to this many characters

PerAccountMaxMessages

Limit reported new emails to this many per account

TotalMaxMessages

Limit total reported new emails to this many

Separators (0 or 1)

Separate accounts with a separator

Debug (0 or 1)

Detailed debug info in the Rainmeter log

SeparatorLength

Separator length

Substitute#
(number at the end 0-8)

Substitute text in the subject. Usage Substitute#="oldtext":"newtext"

From a String measure, call the plugin's GetData(tag) function in a section variable. "tag" indicates which info to get (see table below). Every reported new email will be formatted according to this pattern.

[mGmailSubj]
Meter=String
Text=[&msGmail:GetData("(subject)")]
UpdateDivider=#emailDiv#
DynamicVariables=1
GetData() tags

(name)

Account name

(initial)

First letter of the account name

(count)

New email count

(subject)

Subject line

(fromperson)

The name of the sender (if provided)

(fromemail)

Full email address of the sender

(fromuser)

The "username" of the sender's email (before the @ sign)

(fromhost)

The "host" part of the sender's email (after the @ sign)

(from)

The sender's name, if provided, otherwise the email

(date)

The date the email was received

(time)

The time the email was received (24-hr format)

(time_12_0)

12-hr format with leading zeros

(time_12)

12-hr format without leading zeros

(time_24_0)

24-hr format with leading zeros

(time_24)

24-hr format without leading zeros

(datetime)

Date and time formatted according to your local settings

Note: POP servers have no concept of "unread" mail. To get only unread mail from a POP server, set your mail program to delete mail on the server upon retrieval.

All times are given in local time.

Sample skins (included)

Simple test skin
A simple test skin

Skin with subject user time
A skin showing 2 emails from 2 mailservers: it displays the server initial,
the subject, user (blurred here) and the arrival time. This skin is designed
to drop down / collapse, depending on messages (no messages = nothing visible)

Download

The skins (other than the simple test one) are designed to drop down / collapse, depending on messages (no messages = nothing visible).

Change log:

1.0.0.0

Initial release

1.21.12.28

Made multi-threaded, 6 sec timeout on connections

1.23.1.17

Updated all libraries, Net 4.7 re-target, OAuth2 added

1.23.1.23

Experim. IMAP4 (no headers), debug option

EmailCheckerSimple_plugin_demo_skins_1.23.1.23.rmskin (3.2 MB)

AuthToken.zip - use this if you don't want 2FA in you Google account. Instead, this command line exe will request an OAuth2 token for this plugin. You'll log into your Google account via a consent form and accept. The safety warnings just mean you're letting this plugin access your email. The OAuth2 token can be saved and used as an account password. If the account password is >32 chars long (like the OAuth2 token), then this plugin will treat it as an OAuth2 token and you'll log in with OAuth2.