dqrwgq
Last Updated: February 25, 2016
·
1.382K
· borisguery
543aba69f8cc74c8b0a9c78417e19ecd

Quick and reliable testing SMTP server

python -m smtpd -n -c DebuggingServer -d localhost:25

(Optionally you may need to sudo)

It will start an SMTP server binded on localhost at port 25

Now, when a mail will be processed by your server, it will ouput something like:

Incoming connection from ('127.0.0.1', 64841)
Peer: ('127.0.0.1', 64841)
Data: 'MAIL FROM:<alice@example.com>'
===> MAIL FROM:<alice@example.com>
sender: johndoe@example.com
Data: 'RCPT TO:<bob@example.com>'
===> RCPT TO:<bob@gmail.com>
recips: ['bob@gmail.com']
Data: 'DATA'
Data: 'Email content'
---------- MESSAGE FOLLOWS ----------
Email content
------------ END MESSAGE ------------

If you are tired of the verbosity, you may want to remove the -d flag.

Say Thanks
Respond

1 Response
Add your response

3262
736212 10200976756252420 836055407 o

Debugging SMTP in debian console via Telnet is damn horrible. Thanks for this!

over 1 year ago ·