Git Product home page Git Product logo

mr.hermes's Introduction

Contents

mr.hermes is an extension of the smtpd.DebuggingServer from the Python standard library. It dumps all mails it receives to the standard output and optionally to files in a configurable directory.

There are several ways to use this package. Probably the most two common are the following.

Command line

Install it with your preferred Python packaging tool (setuptools, distribute, pip or whatever). Run it from the command line using python -m smtpd -n -c mr.hermes.DebuggingServer localhost:8025.

If you want to dump the output to a directory, then set the DEBUG_SMTP_OUTPUT_PATH environment variable. For example like DEBUG_SMTP_OUTPUT_PATH=mails python -m smtpd -n -c mr.hermes.DebuggingServer localhost:8025.

Buildout

Add a part to your config like this:

[debugsmtp]
# Run a simple smtp server on 8025 that echos incoming email
recipe = zc.recipe.egg
eggs = mr.hermes
entry-points = debugsmtp=runpy:run_module
scripts = debugsmtp
host = localhost
port = 8025
path = ${buildout:directory}/var/mails
initialization =
    import os
    os.environ.setdefault('DEBUG_SMTP_OUTPUT_PATH', '${:path}')
    sys.argv[1:] = ['-n', '-c', 'mr.hermes.DebuggingServer', '${:host}:${:port}']
arguments = 'smtpd', run_name='__main__', alter_sys=True

You can then add this script to something like supervisord and use mr.laforge to automatically start it when you need it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.