https://github.com/sibyx/django-imap-backend
IMAP backend for Django mail package
https://github.com/sibyx/django-imap-backend
django imap mail
Last synced: 7 months ago
JSON representation
IMAP backend for Django mail package
- Host: GitHub
- URL: https://github.com/sibyx/django-imap-backend
- Owner: Sibyx
- License: mit
- Created: 2020-07-05T20:41:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-07T23:41:47.000Z (over 1 year ago)
- Last Synced: 2025-02-27T04:24:09.813Z (7 months ago)
- Topics: django, imap, mail
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Django IMAP backend
[](https://badge.fury.io/py/django-imap-backend)
IMAP back-end for `django.core.mail` package, aimed for uploading messages to specif mailboxes, instead of sending it
over SMTP (or other Django email backend). Useful for debugging without fancy services like
[mailtrap.io](https://mailtrap.io/). Library is capable of uploading messages to multiple accounts at once (one email
to multiple mailboxes or accounts).If you like nice diagrams, check this
[repository map](https://app.codesee.io/maps/cbe2ee60-2175-11ec-96b5-afe99c614d3c).## Motivation
In last few months I worked on project where we have to send a lot of emails to different mailboxes. We used fake
(and after migration real) e-mail addresses in our staging environment. It was hard to debug these messages without
services like [mailtrap](https://mailtrap.io/) (for which we just didn't want to pay, even it's a pretty cool product,
client's budget is client's budged).We came up with the idea of uploading ready-to-send emails to IMAP user instead of sending it.
## Installation
```shell script
# Using pip
pip install django-imap-backend# Using poetry
peotry add django-imap-backend# Using setup.py
python setup.py install
```## Configuration
Firstly, have to specify `django_imap_backend.ImapBackend` as your `EMAIL_BACKEND` in `settings.py`. Than you need to
add configuration for your mailboxes in `EMAIL_IMAP_SECRETS` list. Your's `setings.py` should looks like this:```python
EMAIL_BACKEND = 'django_imap_backend.ImapBackend'
EMAIL_IMAP_SECRETS = [
{
'HOST': 'imap.example.com',
'PORT': None, # default 143 and for SSL 993
'USER': 'artuhur.dent',
'PASSWORD': 'TheQuestion42',
'MAILBOX': 'my_project', # Created if not exists
'SSL': False # Default
}
]
```---
Made with ❤️ and ☕️ by Jakub Dubec & [BACKBONE s.r.o.](https://www.backbone.sk/en/)