@@ -235,10 +235,10 @@ Gmail OAuth tokens. Run the script as follows:
235
235
236
236
``` shell
237
237
$ sasl-xoauth2-tool get-token gmail \
238
+ PATH_TO_TOKENS_FILE \
238
239
--client-id=CLIENT_ID_FROM_SASL_XOAUTH2_CONF \
239
240
--client-secret=CLIENT_SECRET_FROM_SASL_XOAUTH2_CONF \
240
- --scope=" https://mail.google.com/" \
241
- PATH_TO_TOKENS_FILE
241
+ --scope=" https://mail.google.com/"
242
242
243
243
Please open this URL in a browser ON THIS HOST:
244
244
@@ -344,9 +344,9 @@ Microsoft OAuth tokens. Run the script as follows:
344
344
345
345
``` shell
346
346
$ sasl-xoauth2-tool get-token outlook \
347
+ PATH_TO_TOKENS_FILE \
347
348
--client-id=CLIENT_ID_FROM_SASL_XOAUTH2_CONF \
348
- --use-device-flow \
349
- PATH_TO_TOKENS_FILE
349
+ --use-device-flow
350
350
To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code REDACTED to authenticate.
351
351
```
352
352
@@ -429,8 +429,9 @@ Microsoft OAuth tokens. Run the script as follows:
429
429
430
430
``` shell
431
431
$ sasl-xoauth2-tool get-token outlook \
432
- --client-id=CLIENT_ID_FROM_SASL_XOAUTH2_CONF \
433
- PATH_TO_TOKENS_FILE
432
+ PATH_TO_TOKENS_FILE \
433
+ --client-id=CLIENT_ID_FROM_SASL_XOAUTH2_CONF
434
+
434
435
Please visit the following link in a web browser, then paste the resulting URL:
435
436
436
437
https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize? client_id=REDACTED& response_type=code& redirect_uri=https%3A//login.microsoftonline.com/common/oauth2/nativeclient& response_mode=query& scope=openid%20offline_access%20https%3A//outlook.office.com/SMTP.Send
@@ -558,11 +559,14 @@ Token refresh succeeded.
558
559
$ service postfix restart
559
560
```
560
561
561
- ## Using Multiple Mail Providers Simultaneously
562
+ ## Using Multiple Mail Providers or Users Simultaneously
562
563
563
- One instance of sasl-xoauth2 may provide tokens for different mail providers,
564
- but each provider will require its own client ID, client secret, and token
565
- endpoint. In this case, each of these may be set in the token file rather than
564
+ One instance of sasl-xoauth2 may provide tokens for different mail providers
565
+ and/or users.
566
+ Each provider will require its own client ID, client secret, and token
567
+ endpoint. Each user may require a username to be specified, if the username
568
+ automatically obtained from postfix is not correct.
569
+ In this case, each of these may be set in the token file rather than
566
570
in ` /etc/sasl-xoauth2.conf ` . Set them when setting the initial access token:
567
571
568
572
``` json
@@ -572,7 +576,8 @@ in `/etc/sasl-xoauth2.conf`. Set them when setting the initial access token:
572
576
"client_secret" : " client secret goes here, if required" ,
573
577
"token_endpoint" : " token endpoint goes here, for non-Gmail" ,
574
578
"expiry" : " 0" ,
575
- "refresh_token" : " refresh token goes here"
579
+ "refresh_token" : " refresh token goes here" ,
580
+ "user" : " username goes here"
576
581
}
577
582
```
578
583
0 commit comments