Skip to main content
https://travis-ci.org/34nm/gsmtpd.svg?branch=master

SMTP servers impletement base on Gevent

Install

pip install gsmtpd

Usage

Basically gsmtpd is ported from Python standard lib smtpd, you can it check from Doc

however there is only one difference, you should add monkey patch of gevent

from gevent import monkey
monkey.patch_all()

Example

from gevent import monkey
monkey.patch_all()
from gsmtpd.server import SMTPServer

class DebuggingServer(SMTPServer):
    # Do something with the gathered message
    def process_message(self, peer, mailfrom, rcpttos, data):
        inheaders = 1
        lines = data.split('\n')
        print '---------- MESSAGE FOLLOWS ----------'
        for line in lines:
            # headers first
            if inheaders and not line:
                print 'X-Peer:', peer[0]
                inheaders = 0
            print line
        print '------------ END MESSAGE ------------'

if __name__ == "__main__":

    server = DebuggingServer()
    server.serve_forever()

Performance

The charts below shows gsmtpd vs asyncore based smtpd in Python standrary lib.

https://raw.githubusercontent.com/34nm/gsmtpd/master/helo_chart.png
https://raw.githubusercontent.com/34nm/gsmtpd/master/mail_chart.png

Download files

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

Source Distribution

gsmtpd-0.2.tar.gz (9.6 kB view details)

Uploaded Source

File details

Details for the file gsmtpd-0.2.tar.gz.

File metadata

  • Download URL: gsmtpd-0.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gsmtpd-0.2.tar.gz
Algorithm Hash digest
SHA256 261d4dabd018d89622373f941db7216731019d736f6f6e296e0e4d71a2191eca
MD5 0db1c929c67e84cbae75cb02a33eb3bd
BLAKE2b-256 2737dd7cae474a8334d1d43903696d9a5777b85e891e14a8873d060356331133

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2 This release

1 file

0.1.9.3

1 file

0.1.9.2

1 file

0.1.9.1

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page