Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ given by an absolute path)
Using the latest (>0.12) version of nodejs, one can write myconfig.js as
follows. Assuming the script ~/getpass.sh prints out your password.
(execSync is a v0.12 feature)

You can also use xoauth2 instead of password based authentication by setting
the exports.xoauth2 option to the output of a tool which can provide xoauth2
encoded tokens. Examples: [Google oauth2l](https://github.com/google/oauth2l) or
[xoauth2 fetcher for O365](https://github.com/harishkrupo/oauth2ms)

```javascript
var child_process = require('child_process');

Expand All @@ -80,6 +86,8 @@ follows. Assuming the script ~/getpass.sh prints out your password.
exports.tlsOptions = { "rejectUnauthorized": false };
exports.username = "<user>";
exports.password = getStdout("~/getpass.sh");
// use xoauth2 token (tool from: https://github.com/harishkrupo/oauth2ms)
// exports.xoauth2 = getStdout("oauth2ms --encode-xoauth2");
exports.onNotify = "<sync command>"
exports.onNotifyPost = "<command>"
exports.boxes = [ "box1", "box2", "some/other/box" ];
Expand Down
1 change: 1 addition & 0 deletions bin/imapnotify
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Notifier.prototype.create_connection = function(debug) {
var connection = new Imap({
user: self.config.username,
password: self.config.password,
xoauth2: self.config.xoauth2,
host: self.config.host,
port: self.config.port,
tls: self.config.tls || false,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"notify",
"mail",
"email"
],
"license": "MIT"
],
"license": "MIT"
}