feat(third_party/lieer): Request OAuth2 scope for sending emails

This makes it possible to reuse the lieer tokens for sending emails
from XOAUTH2-compatible SMTP clients.
This commit is contained in:
Vincent Ambo 2019-12-26 12:52:19 +01:00
parent 29af390e8c
commit a07571a4db
2 changed files with 15 additions and 0 deletions

View file

@ -18,6 +18,8 @@ python3Packages.buildPythonApplication rec {
sha256 = "1zzylv8xbcrh34bz0s29dawzcyx39lai8y8wk0bl4x75v1jfynvf";
};
patches = [ ./send_scope.patch ];
propagatedBuildInputs = with python3Packages; [
notmuch
oauth2client

13
third_party/lieer/send_scope.patch vendored Normal file
View file

@ -0,0 +1,13 @@
diff --git a/lieer/remote.py b/lieer/remote.py
index 6e3973a..ade1082 100644
--- a/lieer/remote.py
+++ b/lieer/remote.py
@@ -9,7 +9,7 @@ from oauth2client.file import Storage
from pathlib import Path
class Remote:
- SCOPES = 'https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.modify'
+ SCOPES = 'https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.send'
APPLICATION_NAME = 'Lieer'
CLIENT_SECRET_FILE = None
authorized = False