gpt4 book ai didi

ruby-on-rails - 阻止可疑登录(Heroku,Amazon AWS,Gmail SMTP)

转载 作者:行者123 更新时间:2023-12-03 12:05:20 26 4
gpt4 key购买 nike

我偶尔会收到来自Google的电子邮件(accounts-noreply@google.com),类似于以下内容:

Subject: Suspicious sign in prevented

Someone recently tried to use an application to sign in to your Google
Account, ________@gmail.com. We prevented the sign-in attempt in case
this was a hijacker trying to access your account. Please review the
details of the sign-in attempt:

Monday, November 19, 2012 8:40:55 PM GMT
IP Address: 184.72.161.49 (amazonaws.com)
Location: Dixmoor, IL, USA

If you do not recognize this sign-in attempt, someone else might be trying
to access your account. You should sign in to your account and reset your
password immediately. Find out how at
http://support.google.com/accounts?p=reset_pw

If this was you, and you want to give this application access to your
account, complete the troubleshooting steps listed at
http://support.google.com/mail?p=client_login

Sincerely,
The Google Accounts Team


© 2012 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043

You have received this mandatory email service announcement to update you
about important changes to your Google product or account.

的确如此,这就是我,因为我有一个运行在 Heroku 上的应用程序(因此,为什么IP地址来自 amazonaws.com),并且我通过Gmail SMTP直接从我的应用程序发送电子邮件(我认为这没有关系,但具体来说,我使用的是 gmail_smtp pluginupdated for Rails 3.2)。

有什么办法可以避免这种警告,也可以将已知IP列入白名单?

最佳答案

简短答案

  • 在网络浏览器(可能是Chrome / Incognito)中,登录您的Gmail帐户(尝试通过该帐户从应用程序发送电子邮件的帐户)。
  • 在另一个浏览器选项卡中,打开https://accounts.google.com/DisplayUnlockCaptcha-并按照以下步骤操作。

  • 详细答案

    我最终登录到我的Gmail帐户(在上面的Stackoverflow问题中称为 ________@gmail.com),并看到以下警告:

    [注意:事后我将这个答案拼凑在一起。]单击链接 是吗? ,我敢肯定我被带到了包含以下内容的页面,尽管在它下面有一个消息和按钮,用于向列表添加另一个应用程序:

    [再次,我很确定...]单击该页面上的按钮将我带到 https://accounts.google.com/DisplayUnlockCaptcha -看起来像这样:

    点击 继续将我带到另一页:

    那时,我刚进入我的应用程序,并使其发送电子邮件。

    注意:为了在我的应用程序中进行电子邮件的常规实时测试,我在 triggers#index上有一个 View ,其中有两个按钮可将 PUT请求发送到这些操作: triggers#send_emailtriggers#raise_exception。这使管理员可以转到 /triggers并发送电子邮件,或引发异常以测试生产系统在能够发送电子邮件方面是否正常工作。在我的任何应用程序中,通过 exception_notification向我发送电子邮件详细信息都会引发异常。

    关于ruby-on-rails - 阻止可疑登录(Heroku,Amazon AWS,Gmail SMTP),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13465269/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com