django-mailbox
django-mailbox copied to clipboard
No Token available in python-social-auth
Hello, After installing django mailbox, and adding a new active mailbox as below: name : my gmail address url: gmail+ssl://myaddress%40gmail.com:[email protected]?archive=Archived When I run
python manage.py getmail
I get the following error:
No Token available in python-social-auth for my gmail address
Can anyone help me please?
To handle the handshake and storing the credentials, use python-social-auth.
https://django-mailbox.readthedocs.io/en/latest/topics/mailbox_types.html#gmail-imap-with-oauth2-authentication
See:
https://github.com/coddingtonbear/django-mailbox/blob/26786a0b3200515d490ecb69e1bc5b86efcc0ffb/django_mailbox/transports/gmail.py#L36-L49
https://github.com/coddingtonbear/django-mailbox/blob/26786a0b3200515d490ecb69e1bc5b86efcc0ffb/django_mailbox/google_utils.py#L27-L33
@entissar12 May I ask how did you solve the problem? I have the same issue but I am pretty sure I have python-social-auth installed
Ok the documenation is not so clear on that, but basically you have multiple options:
- BasicAuth directly in the mailbox url:
imap+ssl://<url_encoded_email_address>:<password>@imap.gmail.com(Don't forget to replace with your credentials) - Gmail IMAP with Oauth2: It will require that GOOGLE_OAUTH2 is working and that you already connected with this email address. Then you can configure the mailbox URL to be
imap+ssl://<url_encoded_email_address>:[email protected]?archive=myarchivefolder
I'm closing that issue because it's really old but feel free to re-open if needed