Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从Python smtpd调试服务器到文件/数据库的管道_Python_Linux_Smtpd - Fatal编程技术网

从Python smtpd调试服务器到文件/数据库的管道

从Python smtpd调试服务器到文件/数据库的管道,python,linux,smtpd,Python,Linux,Smtpd,有没有一种方法可以通过管道从Python smtpd调试服务器输出 python -m smtpd -n -c DebuggingServer localhost:1025 在数据库/文件中 我想在一个简单的网页上显示这个端口上的所有流量。如果有更好的方法,请告诉我 感谢您的帮助。我可以使用如下输出重定向将邮件内容发送到文件: python -m smtpd -n -c DebuggingServer localhost:1025 >> mail.txt 我更愿意使用|tee m

有没有一种方法可以通过管道从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
(也可以将邮件内容打印到命令行),但这不起作用

对于您的问题,如果您想查看特定端口上的所有流量,您可能正在寻找类似于tcpdump的内容:

tcpdump -i any port 1025