Python

Bonzo: Minimalistic Python SMTP Proxy

In this week, I built Bonzo, a minismalistic SMTP Proxy built on top of Tornado.

The motivation was that in my current job, we need to do tests on email messages that are sent through our applications. It all started when I saw a GitHub repository that has the first component that we need: an SMTP server, I did a couple of tests and unfortunately I did not have good results, something that not convinced me was the inactivity of the project because it had more than 3 years without having maintenance –although it was not necessary because the protocol has not changed.

Then, a co-worker recommended me to review the smtpd module, and since I’m very stubborn in wanting to use Tornado for all… the next night I decided not to sleep until I have done an SMTP server with all that smtpd implemented based on the code repository that I found at the beginning.

The result was basically an implementation of smtpd to extend the Tornado’s TCPServer class. An example of how to use Bonzo is, as follow:

TODO:

  • Authentication: Probably I will provide a method hook for verify the athentication and to derivate the responsability to a implementor’s logic.
  • TSL: I should to implement a way to support the STARTTLS command.
  • Unit tests!

Links:

P.S.

About the name… I have selected “Bonzo” because it’s the nickname of the drummer of my favorite Rock band and the best world’s drummer.

Standard