我正在尝试验证电子邮件,但是当我遵循mailgun文档并具有如下代码时
https://documentation.mailgun.com/en/latest/user_manual.html#email-validation
EMAILPUBLICVALIDATIONKEY = 'my sexy key'
def validateemail(emailaddress):
return requests.get(
"https://api.mailgun.net/v3/address/validate",
auth=("api", EMAILPUBLICVALIDATIONKEY ),
params={'address': emailaddress}
)
我得到答复
["{"Error":"exposed account credentials"}"]0: "{"Error":"exposed account credentials"}"length: 1__proto__: Array(0)
答案 0 :(得分:2)
我以前从未在MailGun中收到此错误。但是我假设exposed account credentials
意味着您的API密钥被公开,他们为了保护您而停用了它。
Kinda无关,但是GitHub最近发布了一项功能,该功能可以扫描提交中的API密钥和令牌,并通知公司已公开。看起来该MailGun不在该列表中,但是由于它处于Beta版,因此列表没有更新的可能性很小。 https://help.github.com/articles/about-token-scanning/
答案 1 :(得分:1)
这很可能是由于在Github上公开了Mailgun API密钥。我在文件中包含了API密钥,并对其进行了注释,但仍被标记。如果您在Mailgun上提交票证,将通过以下说明发送答复:
Due to the compromise, you will need to take a few steps to secure your Mailgun account:
- Remove the repository from Github or making the repository private. A new commit will not overwrite the previous commit history which contains the password.
- Please log in to the Mailgun Control Panel and reset your Mailgun account password. Click your email address in the top right, "Edit Account Info" -> "Password Change" section.
- Enable 2 Factor Authentication. Click your email address in the top right > Security > Two-Factor Authentication section.
- Reset your Mailgun API key. Under "Account Settings" -> "Security" click the refresh symbol to generate a new API key.
- Reset your SMTP credentials. Go to the "Domains" tab and repeat the following process for each domain listed in this view.
答案 2 :(得分:0)
我不认为Mailgun在该列表中。但是可以添加它们。
现在正式发布(2019年5月23日):“ Token scanning”
令牌扫描现在通常在所有公共存储库中都可用。
此外,令牌扫描现在支持检测来自阿里云, Mailgun 和Twilio的新令牌类型。
完整列表位于“ About token scanning”上。
有关更多信息,请访问“ Token scanning”。
答案 3 :(得分:0)
您需要进入您的Mailgun帐户,横幅会显示您的帐户已被暂停,然后您必须与支持人员联系以对其进行解锁