Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法从 Python smtpd 调试服务器传输输出
python -m smtpd -n -c DebuggingServer localhost:1025
在数据库/文件中?
我想在一个简单的网页上显示此端口上的所有流量。如果有更好的方法请告诉我!
谢谢你的帮助。
我能够使用这样的输出重定向将邮件内容发送到文件:
python -m smtpd -n -c DebuggingServer localhost:1025 >> mail.txt
我更喜欢使用| tee mail.txt而不是>> mail.txt(也将邮件内容打印到命令行),但这不起作用。
| tee mail.txt
>> mail.txt
对于您的问题,如果您想查看特定端口上的所有流量,您可能正在寻找类似 tcpdump 的东西:
tcpdump -i any port 1025