如何验证Google App Engine中收到的电子邮件地址的发件人? [英] How to verify sender of incoming email address in Google App Engine?

查看:188
本文介绍了如何验证Google App Engine中收到的电子邮件地址的发件人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Google App Engine的Python SDK中撰写大量基于电子邮件的应用程序。我注意到,Google 允许您通过其API接收电子邮件,它很容易让您访问标准字段,如From,To,Body等。但是,如果我试图验证一个电子邮件地址来自谁说它来自(某种方式那个Posterous为你做了),我该怎么办?我无法访问任何电子邮件标题,所以我无法检查发送服务器的IP地址的MX记录或任何类似的东西。

I'm trying to write a heavily email-based application in the Python SDK of Google App Engine. I've noticed that Google allows you to receive email via its API, and that it easily gives you access to the standard fields like From, To, Body, etc. However, if I'm trying to verify that an email address came from who it said it came from (kind of in the way that Posterous does it for you), how can I? I don't have access to any of the email headers, so I can't check the MX record of the sending server's IP address or anything fancy like that.

任何想法?

推荐答案

实际上,尽管没有记录,源这里表明,您获得的方便对象的原始MIME邮件可以作为 .original 属性的方便对象 - 这是一个 email.message.Message ,所以你应该可以从那里获取电子邮件标题。不过,我不确定你在进行验证时需要更多的努力。

Actually, while not well documented, the sources here suggest that the original mime message from which the handy objects you get are shaped is available as the .original property of the handy object -- that's an instance of email.message.Message, so you should be able to get email headers from there. I'm not sure that takes you much further in your quest for validation, though.

这篇关于如何验证Google App Engine中收到的电子邮件地址的发件人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆