Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pipe from Python smtpd debugging server to file/database

is there a way to pipe the output from the Python smtpd debugging server

python -m smtpd -n -c DebuggingServer localhost:1025

in a database/file?

I want to show all traffic on this port on a simple webpage. If there is a better way please let me know!

Thanks for your help.

like image 926
user3256707 Avatar asked Sep 02 '26 16:09

user3256707


1 Answers

I was able to send the mail content to a file by using output redirection like this:

python -m smtpd -n -c DebuggingServer localhost:1025 >> mail.txt

I would prefer to use | tee mail.txt instead of >> mail.txt (to also print the mail content to the command line) but that didn't work.

To your question, if you want to see all traffic on a specific port, you are probably looking for something like tcpdump:

tcpdump -i any port 1025
like image 72
Miguel Ferreira Avatar answered Sep 05 '26 07:09

Miguel Ferreira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!