Skip to main content

A fake SMTP server

Project description

Fakemail is a simple SMTP server that runs as a command line script, relaying incoming messages to an upstream server, to an HTTP endpoint or to stdout.

Fakemail is useful for testing emails during development: it can rewrite the envelope-to address on all messages to a single address, ensuring messages cannot be sent to real users.

Fakemail is useful for processing inbound messages in a web application, by acting as an SMTP-to-HTTP proxy.

Caution: Fakemail always runs as an open relay. Ensure you do not expose fakemail on a public address.

Installation

pip install -r requirements.txt

Usage

To see an up to date list of command line options, run:

python fakemail.py --help

Examples

Redirect emails for development:

python fakemail.py –bind 127.0.0.1:2525 –relay 127.0.0.1:25 –rewrite-to=myaddress@example.org

View emails on stdout:

python fakemail.py --bind 127.0.0.1:2525 --stdout

Feed emails into an HTTP endpoint (SMTP-to-HTTP):

python fakemail.py --bind 127.0.0.1:2525 --relay-url="https://mywebservice.example.org/mail-in"

python fakemail.py --bind 127.0.0.1:2525 --relay-url="https://user:pass@mywebservice.example.org/mail-in"

Multiple relays are possible: you can relay via SMTP, to an HTTP endpoint, and log to stdout in a single process. If any one relay fails the mail will be rejected, even if other relays succeed.

Project details


Download files

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

Source Distribution

fakemail-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

fakemail-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file fakemail-0.1.0.tar.gz.

File metadata

  • Download URL: fakemail-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.8.0 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for fakemail-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8142c8c365a3ea8d1142023a8f50deb250a70b973ef2705dc052bd97347707a6
MD5 ebc9a159848cb9504307e1f171ac76f4
BLAKE2b-256 5096850a16416bb1d141a004a0be2de3c3cf7257eab4887897a2ea684811aa2d

See more details on using hashes here.

File details

Details for the file fakemail-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fakemail-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.8.0 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for fakemail-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37b17c1eff87d8910632170d83547b653b52f3ab2b04bfab4e4dc770e80f02a6
MD5 0999398394359c8edb0e18f7732b049a
BLAKE2b-256 083272b50282ba1dbed6085cc7bb2e6c60392eb0fbf7fed209137b3c0f8389f2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page