如何在 Java Google App Engine 中检查传入电子邮件的 DKIM 签名
我正在寻找一种方法来验证传入电子邮件的 DKIM 签名。
我知道如何在 Java SE 中执行此操作,但它将使用 javax.naming.directory.DirContext 等类从 DNS 服务器获取数据,并且该类未在 App Engine 中列入白名单。
知道如何与 Google App 引擎的 DNS 进行通信吗?
配置 DKIM 后,只需发送 来自您的 Google Apps 帐户的电子邮件 至:
几分钟之内,您应该会收到 电子邮件显示“通过”或“失败”。如果 您的测试已通过,一切就绪!
我试过了,它有效! 它看起来像一个 Google App Engine 应用程序。是怎么做到的?!
I am looking for a way to validate the DKIM signature of the incoming email.
I know how to do it in Java SE but it will use classes like javax.naming.directory.DirContext
to get data from DNS server and this class is not white listed in App Engine.
Any idea how to communicate with DNS form Google App engine?
There is a blog post that says:
Once you've configured DKIM, just send
an email from your Google Apps account
to:within minutes, you should get back an
email that says "PASS" or "FAIL". If
your test passed, you're all set!
I tried it and it works!
It seems like a Google App Engine Application. How is it done?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我是 dkim-test 应用程序的作者。不幸的是,我实际上并没有找到在 AppEngine 中执行 DNS 查询的本机方法。 AppEngine 问题跟踪器中存在一个功能请求:
http://code。 google.com/p/googleappengine/issues/detail?id=354
我为 dkim-test 解决此问题的方法是向 http://whatsmyip.us/dns_txt.php?host=google.com(其中google.com 是我想要检索 TXT 记录的主机)。
显然这里有一些缺点。 dkim-test 完全依赖于whatsmyip.us 来工作,如果该服务出现故障或者他们决定阻止 dkim-test,那么它就会崩溃。如果他们改变响应的格式,事情也会崩溃。
I'm the author of the dkim-test app. Unfortunately I did not actually find a native way to do DNS queries in AppEngine. There's a feature request in the AppEngine issues tracker here:
http://code.google.com/p/googleappengine/issues/detail?id=354
The way I got around this for dkim-test was to do a HTTP GET request to http://whatsmyip.us/dns_txt.php?host=google.com (where google.com is the host I want to retrieve TXT records for).
Obviously there are some down sides here. dkim-test is entirely dependent on whatsmyip.us to work, should that service go down or they decide to block dkim-test, then it would break. Things would also break if they changed the format of the response.