Running debug SMTP server with python

Python has builtin module for creating smtp server since version 2.x, sometime for me it's very useful when i just want to run lightweight smtp instance without need to run the actual one such as postfix (in zimbra distribution). the purpose of it may vary but i often used for debugging mail sending between smtp server.

It's very easy to use it, no code need just execute following command.

$ python -m smtpd -d -n -c DebuggingServer

  • -m : run inline command from specific module.
  • -d : print out all smtp message in wire.
  • -n : the daemon will run as nobody.
  • -c : smtpd class that will be used, if you not specified it then it will use PureProxy (transfer received smtp message to another smtp instance)
  • specified in which IP and port where it will listen.

Further more you can see more detail by from it's help message
$ python -m smtpd --help


  1. Nice article, Which you have shared here about the SMTP server. Your article is very informative and useful to know more about the process of Running debug SMTP server with python. If anyone looking for the Reliable SMTP Server online, Visit Mails2inbox


Post a Comment

Popular posts from this blog

Menambahkan Library Path Pada Pycharm

Dark ozpy

Tutorial membuat menu/navigasi pada django