Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.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 IMAP和电子邮件模块以及空白的问题_Python_Email_Imap_Whitespace - Fatal编程技术网

python IMAP和电子邮件模块以及空白的问题

python IMAP和电子邮件模块以及空白的问题,python,email,imap,whitespace,Python,Email,Imap,Whitespace,在阅读电子邮件正文(gmail)时,似乎存在一些不一致之处 问题在于需要验证。它与从我的web浏览器直接复制+粘贴的版本不一致。在不需要的地方有“\n”,并且添加了“\r”。这给我用gnupg验证签名带来了麻烦。我能做些什么来解决这个问题吗?你能提供一个你所期望和看到的例子吗?例如,SMTP通常要求所有行以CRLF结尾。 result, ems =mail.search(None,'ALL')#'UNSEEN') if(result=='OK' and ems!=['']): for e

在阅读电子邮件正文(gmail)时,似乎存在一些不一致之处


问题在于需要验证。它与从我的web浏览器直接复制+粘贴的版本不一致。在不需要的地方有“\n”,并且添加了“\r”。这给我用gnupg验证签名带来了麻烦。我能做些什么来解决这个问题吗?

你能提供一个你所期望和看到的例子吗?例如,SMTP通常要求所有行以CRLF结尾。
result, ems =mail.search(None,'ALL')#'UNSEEN')
if(result=='OK' and ems!=['']):
    for em in ems[0].split():
        preparse = mail.fetch(em,"(RFC822)")
        msg = email.message_from_string(preparse[1][0][1])
        for part in msg.get_payload():
            if part.get_content_type() == 'text/plain':
                to_verify = part.get_payload()
                print to_verify
                verified = verify(to_verify)