Add support for tab-completion when selecting by rule
[alpine.git] / scripts / README
blobccf73542d527e7413647758c77c4174dd4cbc9d2
1 Scripts in this directory can be useful to those that use Alpine in conjunction with other 
2 tools, such as fetchmail. 
4 ooauth2.py:
5 -----------
6 The script ooauth2.py is a python script that can be used to obtain the initial refresh token 
7 and access token for an app, or to renew an access token, and in both cases obtain the encoded 
8 base64 encoded string that is used to add to an authorization command in an IMAP or SMTP 
9 server.
11  * In order to get the initial refresh token and access token, determine the tenant
12    you will use. The default is 'common'. You also need to supply the client-id of
13    your app.
15    ooauth2  [--tenant=common] --client_id=f21d...  --generate_refresh_and_access_token
17    The script will give you a url and a code. Open the url with a browser and enter
18    the code where requested. You will be redirected to login with your username
19    and password. After a successful login, you will be asked to authorize
20    the app. Once you have authorized the app, close that window and return to
21    this script. Press "ENTER" and you will see your refresh-token, access-token
22    and total amount of time (in seconds) that your token is valid. This is typically
23    3600 seconds (one hour). Please note that the refresh token and access token are
24    very long strings, each one them should be saved in a file one line long each.
26  * You can also use this script to generate a new access_token. In order to do this
27    you need the tenant, the client-id, and a refresh-token. Then you would run this
28    script as
30    ooauth2 [--tenant=common] --client_id=f21d... --refresh_token=MCRagxlHaZfUvV9kG0lnBk...
32    as an advice copy and paste the refresh token that you were given into a file,
33    and replace the command line option
34       --refresh_token=MCRagxlHaZfUvV9kG0lnBk...
35    by
36       --refresh_token=`cat filename`
38  * The last way to use this script is to use the previous commands, but add
39    --encoded to any of the previous commands. This will produce a base64 string that
40    can be added to an IMAP "AUTHENTICATE XOAUTH2" command, or a "AUTH XOAUTH2" SMTP
41    command, to login to that server. The access token will not be displayed, only
42    the encoded base64 string. If you use this option, you must also provide
43    the --user option. For example:
45     ooauth2  [--tenant=common] --client_id=f21d... --generate_refresh_and_access_token \
46      --encoded --user=YourID@outlook.com
48    or
50    ooauth2 [--tenant=common] --client_id=f21d... --refresh_token=MCRagxlHaZfUvV9kG0lnBk... \
51    --encoded --user=YourID@outlook.com
53 A complete set of instructions, with images showing this process, can be found at
54 http://alpine.x10host.com/scripts/ooauth2.html