Offlineimap : Différence entre versions
(Page créée avec « Offline Imap sert initialement à synchroniser des boîtes mail entre elles où vers un dossier local. On s'en sert ici uniquement dans le sens sauvegarde d'une boîte IMA... ») |
|||
| Ligne 39 : | Ligne 39 : | ||
Pour générer les données oauth2 : | Pour générer les données oauth2 : | ||
<code> | <code> | ||
| − | [ | + | This option stands in the [Repository RemoteExample] section. |
| − | + | # | |
| + | # XOAuth2 authentication (for instance, to use with Gmail). | ||
| + | # | ||
| + | # This feature is currently EXPERIMENTAL (tested on Gmail only, but should work | ||
| + | # with type = IMAP for compatible servers). | ||
| + | # | ||
| + | # Mandatory parameters are "oauth2_client_id", "oauth2_client_secret" and | ||
| + | # "oauth2_refresh_token". See below to learn how to get those. | ||
| + | # | ||
| + | # Specify the OAuth2 client id and secret to use for the connection.. | ||
| + | # Here's how to register an OAuth2 client for Gmail, as of 10-2-2016: | ||
| + | # - Go to the Google developer console | ||
| + | # https://console.developers.google.com/project | ||
| + | # - Create a new project | ||
| + | # - In API & Auth, select Credentials | ||
| + | # - Setup the OAuth Consent Screen | ||
| + | # - Then add Credentials of type OAuth 2.0 Client ID | ||
| + | # - Choose application type Other; type in a name for your client | ||
| + | # - You now have a client ID and client secret | ||
| + | # | ||
| + | #oauth2_client_id = YOUR_CLIENT_ID | ||
| + | #oauth2_client_secret = YOUR_CLIENT_SECRET | ||
| − | + | # Specify the refresh token to use for the connection to the mail server. | |
| − | + | # Here's an example of a way to get a refresh token: | |
| − | + | # - Clone this project: https://github.com/google/gmail-oauth2-tools | |
| − | + | # - Type the following command-line in a terminal and follow the instructions | |
| − | + | # python python/oauth2.py --generate_oauth2_token \ | |
| − | + | # --client_id=YOUR_CLIENT_ID --client_secret=YOUR_CLIENT_SECRET | |
| − | + | # | |
| − | + | #oauth2_refresh_token = REFRESH_TOKEN | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | oauth2_refresh_token = | ||
</code> | </code> | ||
Version actuelle datée du 3 novembre 2015 à 14:18
Offline Imap sert initialement à synchroniser des boîtes mail entre elles où vers un dossier local. On s'en sert ici uniquement dans le sens sauvegarde d'une boîte IMAP standard vers gmail.
Installation de OfflineImap : http://offlineimap.org/doc/installation.html#single-user
~/
[general]
accounts = Test
[Account Test] localrepository = Croc remoterepository = Gmail
[Repository Croc] type = IMAP remotehost = imap.server.org remoteuser = mail@server.org remotepass = password
ssl = yes or no sslcacertfile = /etc/ssl/certs/ca-certificates.crt readonly = true
[Repository Gmail] type = Gmail remoteuser = mail@gmail.com remotepass = password folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail'] ssl = yes sslcacertfile = /etc/ssl/certs/ca-certificates.crt
oauth2_client_id = Client ID oauth2_client_secret = secret ID oauth2_refresh_token = refresh token
Pour générer les données oauth2 :
This option stands in the [Repository RemoteExample] section.
- XOAuth2 authentication (for instance, to use with Gmail).
- This feature is currently EXPERIMENTAL (tested on Gmail only, but should work
- with type = IMAP for compatible servers).
- Mandatory parameters are "oauth2_client_id", "oauth2_client_secret" and
- "oauth2_refresh_token". See below to learn how to get those.
- Specify the OAuth2 client id and secret to use for the connection..
- Here's how to register an OAuth2 client for Gmail, as of 10-2-2016:
- - Go to the Google developer console
- https://console.developers.google.com/project
- - Create a new project
- - In API & Auth, select Credentials
- - Setup the OAuth Consent Screen
- - Then add Credentials of type OAuth 2.0 Client ID
- - Choose application type Other; type in a name for your client
- - You now have a client ID and client secret
- oauth2_client_id = YOUR_CLIENT_ID
- oauth2_client_secret = YOUR_CLIENT_SECRET
- Specify the refresh token to use for the connection to the mail server.
- Here's an example of a way to get a refresh token:
- - Clone this project: https://github.com/google/gmail-oauth2-tools
- - Type the following command-line in a terminal and follow the instructions
- python python/oauth2.py --generate_oauth2_token \
- --client_id=YOUR_CLIENT_ID --client_secret=YOUR_CLIENT_SECRET
- oauth2_refresh_token = REFRESH_TOKEN