PyMOTW: smtpd

The smtpd module includes classes for building simple mail transport protocol servers. It is the server-side of the protocol used by smtplib.

Read more at pymotw.com: smtpd