1

我正在开发一个基于 Web 的应用程序,为此我需要能够将传入的电子邮件发送到特定地址(已经完成)到 python 脚本(已经完成)。我很容易地设置了管道,但是当我向目标地址发送电子邮件时,我得到了以下回复:

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  pipe to |/path/to/script.py
    generated by ****@****.com
    local delivery failed

脚本如下所示(显然还没有做任何事情):

#!/home2/tsassone/python/bin/python    
def main():    
    pass

if __name__ == '__main__':
    main() 

我知道路径都是正确的,并且 hash-bang 用于其他功能脚本。电子邮件需要做的就是提取消息的正文/内容并对其进行解析(将某些部分放入数据库中)。我需要做些什么来修复管道以防止错误,以及一旦我有如何访问电子邮件正文(我了解如何使用标准输入,并阅读了一些电子邮件解析,但这些都不起作用,尽管我'不确定那是因为管道坏了还是其他原因)。

感谢您的时间。

4

0 回答 0