Skip to main content

Imap authentification backend for Django

Project description


django-imapauth is a simple IMAP authentification backend for django.

Quick start

Requirements :
* Django 1.4.3 (tested).

1. Install the app

pypi version

pip install django-imapauth

development version

pip install -e git+

2. Add ```'imapauth.backends.IMAPBackend'``` to your ```AUTHENTICATION_BACKENDS``` setting


3. Add ```IMAPAUTH_HOST``` in your settings

IMAPAUTH_HOST = 'my_imap_host'


With django-imapauth, when a user try to authenticate in your system, the ```IMAPBackend``` will try to connect to the ```IMAPAUTH_HOST``` with his credentials.
Be careful, it's not because a user is authenticated that he can access the admin site. For that, refer to the example below, and use ```CustomIMAPBackend``` in ```AUTHENTICATION_BACKENDS```:

from imapauth.backends import IMAPBackend

class CustomIMAPBackend(IMAPBackend):
def authenticate(self, username=None, password=None):
user = super(CustomIMAPBackend, self).authenticate(username, password)
if user is None:
return None
user.is_staff = True
return user

Further information

IMAPBackend copied from

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-imapauth-0.1.tar.gz (3.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page