📜 ⬆️ ⬇️

Inbox.py: the simplest SMTP server

Kenneth Reitz from Heroku continues to create elegant libraries with simplified APIs. The previous development was the Requests library for HTTP requests. Now he has released a simple SMTP server Inbox.py , which can be easily attached to a web application for direct mailing and receiving / processing mail without torment with sendmail macros.

from inbox import Inbox inbox = Inbox() @inbox.collate def handle(to, sender, body): ... # Bind directly. inbox.serve(address='0.0.0.0', port=4467) 


 if __name__ == '__main__': inbox.dispatch() 

 $ dasinbox.py 0.0.0.0 4467 [2012-04-28 07:31] INFO: inbox: Starting SMTP server at 0.0.0.0:4467 

The server is running asynchronously. Kenneth says that one instance processes 1000+ letters per second, thanks to the use of the Gevent library.

Inbox.py is a simple small library, but if you need a fully functional SMTP server in Python, then it is better to use Lamson .

')

Source: https://habr.com/ru/post/143241/


All Articles