javamail 是一个不太安全的应用程序吗?

2022-01-23 00:00:00 email gmail email-client java jakarta-mail

我正在开发一个电子邮件程序,该程序可以读取来自 Gmail 的电子邮件并进行进一步处理.最初使用 SO 中提供的代码(下面提供的链接)我得到一个异常,上面写着我的访问已被阻止,我需要通过网络浏览器登录".

I was just working on an email program that read emails from Gmail and does further processing. Initially using the code provide in SO(link provided below) I was getting an exception which says that "My access has been blocked and I need to login via web browser".

同时,我在收件箱(我正在尝试连接)中看到一封电子邮件,上面写着Google 帐户:登录尝试被阻止",我需要从以下链接https://www.google.com/settings/security/lesssecureapps".

On the same time I saw an email in inbox (to which I am trying to connect) which says that "Google Account: sign-in attempt blocked" and I need to disable modern security from following link "https://www.google.com/settings/security/lesssecureapps".

我尝试禁用并成功连接.

I tried to disable and I was succesfully connected.

那么这是否意味着 Javamail 是一个不太安全的应用程序?或者有一些方法可以在不禁用该选项的情况下仍然连接?

So does it means that Javamail is a less secure application? Or there are ways by which I can still connect without disabling the option?

提前致谢.加里

[我使用的代码:]

推荐答案

这真的很难说,因为谷歌并没有确切说明应用程序需要实施什么现代安全标准"才能更安全",但我怀疑他们指的是 这个博客条目他们谈论 OAuth2.JavaMail 能够使用 OAuth2 身份验证机制,我猜这使 JavaMail 成为更安全" 应用程序.

It's really hard to tell because Google isn't saying exactly what "modern security standards" an app needs to implement to be "more secure", but I suspect they're referring to this blog entry where they talk about OAuth2. JavaMail is capable of using the OAuth2 authentication mechanism, which I guess makes JavaMail a "more secure" application.

相关文章