阻止了可疑登录(Heroku,Amazon AWS,Gmail SMTP)

use*_*833 20 gmail smtp ruby-on-rails heroku amazon-web-services

我偶尔会收到来自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.
Run Code Online (Sandbox Code Playgroud)

事实上,这就是我,因为我有一个在Heroku上运行的应用程序(因此IP地址来自amazonaws.com哪里),我通过Gmail SMTP直接从我的应用程序发送电子邮件(我不认为它应该重要,但具体来说,我'使用我为Rails 3.2更新gmail_smtp插件.

有没有办法避免这种警告,或者将已知IP列入白名单的方法?

use*_*833 37

简答

  1. 在网络浏览器(可能是Chrome/Incognito)中,登录您的Gmail帐户(您尝试从应用中发送电子邮件的帐户).

  2. 在另一个浏览器标签中,打开https://accounts.google.com/DisplayUnlockCaptcha - 然后按照相应步骤操作.

答案很长

我最终登录了我的Gmail帐户(如________@gmail.com上面的Stackoverflow问题中所述)并看到以下警告:

在此输入图像描述

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

在此输入图像描述

[再一次,我非常确定 ......]点击该页面上的按钮,我转到https://accounts.google.com/DisplayUnlockCaptcha - 看起来像这样:

在此输入图像描述

单击" 继续"将我带到另一页:

在此输入图像描述

那时我刚去了我的应用程序,并发送了一封电子邮件.

注意:对于我的应用程序中的电子邮件的一般实时测试,我有一个视图,triggers#index有两个按钮发送PUT请求这些操作:triggers#send_emailtriggers#raise_exception.这使得管理员可以转到/triggers发送电子邮件引发例外以测试生产系统是否正常工作,只要能够发送电子邮件.通过exception_notification在我的任何应用程序电子邮件详细信息中引发异常.