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.
Written by Boris Guéry
Related protips
1 Response
Debugging SMTP in debian console via Telnet is damn horrible. Thanks for this!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#