@@ -83,9 +83,9 @@ local_address = 127.0.0.1
83
83
[Account setup]
84
84
documentation = Accounts are specified using your email address as the section heading (e.g., [
[email protected] ],
85
85
etc, below). Account usernames (i.e., email addresses) must be unique - only one entry per account is permitted.
86
- Each account section must provide values for `permission_url`, `token_url`, `oauth2_scope` and `redirect_uri `. If
87
- you are adding an account for a service other than the examples shown below then the provider's documentation should
88
- provide these details.
86
+ Each account section must provide values for at least `token_url`, `oauth2_scope` and `client_id `. Depending on the
87
+ OAuth 2.0 flow you are using, other values may also be required (see examples below). If you are adding an account
88
+ for a service other than the examples shown below then the provider's documentation should provide these details.
89
89
90
90
You will also need to add your own `client_id` and `client_secret` values as indicated below. These can either be
91
91
reused from an existing source (such as another email client that supports OAuth 2.0), or you can register and use
@@ -228,7 +228,6 @@ documentation = *** note: this is an advanced O365 account example; in most case
228
228
token_url = https://login.microsoftonline.com/*** your tenant id here ***/oauth2/v2.0/token
229
229
oauth2_scope = https://outlook.office365.com/.default
230
230
oauth2_flow = client_credentials
231
- redirect_uri = http://localhost
232
231
client_id = *** your client id here ***
233
232
client_secret = *** your client secret here ***
234
233
@@ -237,7 +236,6 @@ documentation = *** note: this is an advanced O365 account example; in most case
237
236
token_url = https://login.microsoftonline.com/*** your tenant id here ***/oauth2/v2.0/token
238
237
oauth2_scope = https://outlook.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send offline_access
239
238
oauth2_flow = password
240
- redirect_uri = http://localhost
241
239
client_id = *** your client id here ***
242
240
client_secret = *** your client secret here ***
243
241
@@ -246,7 +244,6 @@ documentation = *** note: this is an advanced Google account example; in most ca
246
244
token_url = https://oauth2.googleapis.com/token
247
245
oauth2_scope = https://mail.google.com/
248
246
oauth2_flow = service_account
249
- redirect_uri = http://localhost
250
247
client_id = file
251
248
client_secret = *** your /path/to/service-account-key.json here ***
252
249
@@ -255,7 +252,6 @@ documentation = *** note: this is an advanced Google account example; in most ca
255
252
token_url = https://oauth2.googleapis.com/token
256
253
oauth2_scope = https://mail.google.com/
257
254
oauth2_flow = service_account
258
- redirect_uri = http://localhost
259
255
client_id = key
260
256
client_secret = *** your pasted service account JSON key file contents here,
261
257
making sure to indent all lines by at least one space ***
@@ -292,6 +288,15 @@ documentation = The parameters below control advanced options for the proxy. In
292
288
using catch-all accounts or the proxy's `--cache-store` parameter you must manually remove unencrypted secrets from
293
289
the local configuration file after the encrypted secret has been created (i.e., this will not be automatic).
294
290
291
+ - use_login_password_as_client_credentials_secret (default = False): When using the O365 client credentials grant
292
+ (CCG) flow, rather than encrypting the client secret (see above), the proxy can be instructed to use the given
293
+ IMAP/POP/SMTP login password as the client secret. This approach removes the risk of storing the unencrypted client
294
+ secret in the proxy's configuration file, and also means there is no risk of unauthorised account access when using
295
+ the O365 CCG flow in conjunction with the proxy's catch-all mode (see below). To enable this option, set
296
+ `use_login_password_as_client_credentials_secret` to True. Note that if a `client_secret` value is present in your
297
+ account's configuration entry, that value will be used instead of the given IMAP/POP/SMTP login password even if
298
+ this option is enabled. To avoid this, remove the entire `client_secret` line from the configuration entry.
299
+
295
300
- allow_catch_all_accounts (default = False): The default behaviour of the proxy is to require a full separate
296
301
configuration file entry for each account. However, when proxying multiple accounts from the same domain it can be
297
302
cumbersome to have to create multiple near-identical configuration profiles. To simplify this the proxy supports
@@ -308,4 +313,5 @@ documentation = The parameters below control advanced options for the proxy. In
308
313
[emailproxy]
309
314
delete_account_token_on_password_error = True
310
315
encrypt_client_secret_on_first_use = False
316
+ use_login_password_as_client_credentials_secret = False
311
317
allow_catch_all_accounts = False
0 commit comments