mail-devel


Namemail-devel JSON
Version 0.15.0 PyPI version JSON
download
home_pagehttps://github.com/fkantelberg/mail-devel
SummaryIMAP and SMTP in memory test server
upload_time2025-01-20 19:43:14
maintainerNone
docs_urlNone
authorFlorian Kantelberg
requires_python>=3.11
licenseMIT
keywords imap smtp development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mail-devel)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# mail-devel

This tool combines an in-memory SMTP mail-sink with an IMAP server. All mails coming over SMTP
are stored in the IMAP inbox. This can be used to test outgoing and incoming mail configurations.
Built on top of [aiosmtpd](https://github.com/aio-libs/aiosmtpd) and [pymap](https://github.com/icgood/pymap/).

The frontend is minimally handling the content of the mailbox. Please connect a proper mail client
like Thunderbird for more advanced usage.

DO NOT USE FOR PRODUCTION.

## Features

- Receive, send mails, and reply to mails
- Generate randomized mails using the HTTP frontend
- Manage IMAP flags and automated flagging
- Minimal HTTP frontend to support the basic testing
- SMTP auto respond feature for automatic testing (see `--smtp-responder`)
- Single or multi mail account mode (see [configuration](#configuration))

## Usage

### Docker

```bash
docker run -p 4080:4080 -p 4025:4025 -p 4143:4143 --rm fkantelberg/mail-devel --password abc
```

### Docker Compose

The following example assumes that the tool is run in a docker compose network as one of
the services and only need to publish the HTTP port.

- Minimally define password in `.env` with `MAILSINK_PASSWORD`
- Additionally define port in `.env` with `MAILSINK_HTTP`

Following the section from the `docker-compose.yaml`:

```yaml
services:
  mailsink:
    image: fkantelberg/mail-devel:${MAILSINK_TAG:-latest}
    environment:
      MAIL_USER: ${MAILSINK_USER:-test@example.org}
    command: [--password, $MAILSINK_PASSWORD, --smtp-flagged-seen]
    ports:
      - ${MAILSINK_HTTP:-127.0.0.1:4080}:4080
      # If you want to connect a normal mail client via SMTP and IMAP
      # - ${MAILSINK_SMTP:-127.0.0.1:4025}:4025
      # - ${MAILSINK_IMAP:-127.0.0.1:4143}:4143
```

### Python

```bash
$ pip install mail-devel
$ mail_devel --password secret
```

## Configuration

Please use `--help` for a more complete overview of the configurations.

- `--password`: The password for SMTP and IMAP
- `--auth-required`: Disables SMTP without authentication
- `--flagged-seen`: If set incoming mails are automatically flagged as seen/read. If you only want to flag mails coming via SMTP as seen use `--smtp-flagged-seen`
- `--multi-user`: Switches from single user to multi user mode

  - **Single User Mode:** All mails are collected in a single mailbox which belongs to the defined user.

  - **Multi User Mode:** The mails are collected in the specific mailboxes for each receiver of the messages using the `to`, `cc`, and `bcc` mail headers.

- `--auto-responder`: Automatically respond to the mails coming in via SMTP

  - `--auto-responder reply_once`: Reply once per mail thread
  - `--auto-responder reply_always`: Always reply to incoming mails
  - `--auto-responder path/to/script.py`: Custom auto responder. See [the examples](https://github.com/fkantelberg/mail-devel/blob/master/src/mail_devel/automation)

## Supported protocols for mails

- SMTP (optionally with STARTTLS)
- SMTPS
- IMAP (optionally with STARTTLS)

## References

- [Github](https://github.com/fkantelberg/mail-devel)
- [PyPI Package](https://pypi.org/project/mail-devel)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fkantelberg/mail-devel",
    "name": "mail-devel",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "imap smtp development",
    "author": "Florian Kantelberg",
    "author_email": "florian.kantelberg@mailbox.org",
    "download_url": null,
    "platform": null,
    "description": "[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mail-devel)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n# mail-devel\n\nThis tool combines an in-memory SMTP mail-sink with an IMAP server. All mails coming over SMTP\nare stored in the IMAP inbox. This can be used to test outgoing and incoming mail configurations.\nBuilt on top of [aiosmtpd](https://github.com/aio-libs/aiosmtpd) and [pymap](https://github.com/icgood/pymap/).\n\nThe frontend is minimally handling the content of the mailbox. Please connect a proper mail client\nlike Thunderbird for more advanced usage.\n\nDO NOT USE FOR PRODUCTION.\n\n## Features\n\n- Receive, send mails, and reply to mails\n- Generate randomized mails using the HTTP frontend\n- Manage IMAP flags and automated flagging\n- Minimal HTTP frontend to support the basic testing\n- SMTP auto respond feature for automatic testing (see `--smtp-responder`)\n- Single or multi mail account mode (see [configuration](#configuration))\n\n## Usage\n\n### Docker\n\n```bash\ndocker run -p 4080:4080 -p 4025:4025 -p 4143:4143 --rm fkantelberg/mail-devel --password abc\n```\n\n### Docker Compose\n\nThe following example assumes that the tool is run in a docker compose network as one of\nthe services and only need to publish the HTTP port.\n\n- Minimally define password in `.env` with `MAILSINK_PASSWORD`\n- Additionally define port in `.env` with `MAILSINK_HTTP`\n\nFollowing the section from the `docker-compose.yaml`:\n\n```yaml\nservices:\n  mailsink:\n    image: fkantelberg/mail-devel:${MAILSINK_TAG:-latest}\n    environment:\n      MAIL_USER: ${MAILSINK_USER:-test@example.org}\n    command: [--password, $MAILSINK_PASSWORD, --smtp-flagged-seen]\n    ports:\n      - ${MAILSINK_HTTP:-127.0.0.1:4080}:4080\n      # If you want to connect a normal mail client via SMTP and IMAP\n      # - ${MAILSINK_SMTP:-127.0.0.1:4025}:4025\n      # - ${MAILSINK_IMAP:-127.0.0.1:4143}:4143\n```\n\n### Python\n\n```bash\n$ pip install mail-devel\n$ mail_devel --password secret\n```\n\n## Configuration\n\nPlease use `--help` for a more complete overview of the configurations.\n\n- `--password`: The password for SMTP and IMAP\n- `--auth-required`: Disables SMTP without authentication\n- `--flagged-seen`: If set incoming mails are automatically flagged as seen/read. If you only want to flag mails coming via SMTP as seen use `--smtp-flagged-seen`\n- `--multi-user`: Switches from single user to multi user mode\n\n  - **Single User Mode:** All mails are collected in a single mailbox which belongs to the defined user.\n\n  - **Multi User Mode:** The mails are collected in the specific mailboxes for each receiver of the messages using the `to`, `cc`, and `bcc` mail headers.\n\n- `--auto-responder`: Automatically respond to the mails coming in via SMTP\n\n  - `--auto-responder reply_once`: Reply once per mail thread\n  - `--auto-responder reply_always`: Always reply to incoming mails\n  - `--auto-responder path/to/script.py`: Custom auto responder. See [the examples](https://github.com/fkantelberg/mail-devel/blob/master/src/mail_devel/automation)\n\n## Supported protocols for mails\n\n- SMTP (optionally with STARTTLS)\n- SMTPS\n- IMAP (optionally with STARTTLS)\n\n## References\n\n- [Github](https://github.com/fkantelberg/mail-devel)\n- [PyPI Package](https://pypi.org/project/mail-devel)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "IMAP and SMTP in memory test server",
    "version": "0.15.0",
    "project_urls": {
        "Homepage": "https://github.com/fkantelberg/mail-devel"
    },
    "split_keywords": [
        "imap",
        "smtp",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ecc58203b1c7595d4a2e8df4bf7d7725081344cd34c6e6f4dfa746d8d738b68",
                "md5": "10d3277ae8cf47557e578865b7eaf27b",
                "sha256": "aa004b7083f0dd8b0f9151f7af3242ead8714b4d3a360fa9091be053f2dfec2b"
            },
            "downloads": -1,
            "filename": "mail_devel-0.15.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "10d3277ae8cf47557e578865b7eaf27b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 28716,
            "upload_time": "2025-01-20T19:43:14",
            "upload_time_iso_8601": "2025-01-20T19:43:14.642251Z",
            "url": "https://files.pythonhosted.org/packages/8e/cc/58203b1c7595d4a2e8df4bf7d7725081344cd34c6e6f4dfa746d8d738b68/mail_devel-0.15.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-20 19:43:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fkantelberg",
    "github_project": "mail-devel",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mail-devel"
}
        
Elapsed time: 0.39504s