无法使用Windows身份验证向SMTP服务器进行身份验证

用户名

我整天都在研究,真是机智!我只是无法让我的smtp服务器与Windows用户进行身份验证-我在做什么错?我不断收到错误:

SMTP服务器需要安全连接,或者客户端未通过身份验证。服务器响应为:5.7.3客户端未通过身份验证

我的smtp设置为在访问选项卡中将“身份验证”设置为“集成Windows身份验证”:

在此处输入图片说明

并且我的中继限制设置为仅以下列表,并且我已经将127.0.0.1添加到该列表中。我也选中了“允许所有通过身份验证的计算机进行中继”复选框,而不管上面的列表如何

在此处输入图片说明

其他所有内容仍设置为默认值。我的代码说:

var objMessage = new MailMessage("[email protected]", "[email protected]");

// format subject and message
objMessage.Subject = "testing email";
objMessage.Body = "blah blah";

using (var client = new SmtpClient())
{
    client.Host = "127.0.0.1";
    client.Port = 25;
    client.UseDefaultCredentials = false;
    client.Credentials = new System.Net.NetworkCredential("SMTPuser", "mypassword");
    client.Send(objMessage);
}

我已经在计算机上使用匹配的密码创建了一个标准的Windows用户SMTPuser。我很困惑。Windows身份验证应该如何工作?我弄错了什么假设?为什么我所有的安全级别都设置为“匿名”时才能够发送?

All I want to do is send mail to any domain (I don't need to receive mail), and obviously protect my server from spammers using it to send out their spam. For now, the only legitimate access should be coming from localhost. From the research that I did, it seems like I could accomplish what I want by setting everything to anonymous, but then limiting the connections to 127.0.0.1 and the relay restrictions to 127.0.0.1 - is that right? I'm on the verge of resorting to that, but I'd really like to understand how this works especially in the case where I might want to remotely access the smtp server one day.

Am I way off base to think I could set up a server that would allow anybody who can authenticate with my SMTPuser Windows login to be able to use my smtp server to send email to any domain?

krisku

您应该在SMTP服务中启用基本身份验证,因为SmtpClient类不使用集成Windows身份验证。

将访问SMTP服务限制为仅127.0.0.1就足够了,因为这将有效地阻止任何人从外部使用该服务。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Laravel - 无法使用用户名在 SMTP 服务器上进行身份验证

脚本使用Gmail发送邮件:无法在SMTP服务器上进行身份验证

无法使用gmail对SMTP服务器进行身份验证错误

Symfony 2 Swiftmailer + Amazon SES:无法使用2个可能的身份验证器在用户名“ XXXXXXXXXXXXXXXX”的SMTP服务器上进行身份验证

无法使用3个可能的身份验证器使用用户名“ [email protected]”在SMTP服务器上进行身份验证

无法使用2个可能的身份验证器使用用户名在SMTP服务器上进行身份验证

无法使用smtp.office365.com中的用户名在SMTP服务器上进行身份验证

使用Google身份验证在SSH服务器上进行两因素身份验证

Java-SSL-使用gmail的SMTP服务器进行身份验证

无法使用 SMTP Gmail 服务器发送电子邮件身份验证

ASP.Net Web Forms App无法使用Windows身份验证在服务器上进行身份验证-模拟失败

使用 CURL 向 SAML 服务器进行身份验证

身份服务器4 Windows身份验证

无法使用服务帐户向Doubleclick出价管理器Api进行身份验证

无法使用远程服务器在本地进行身份验证

无法使用编码密码对Spring OAuth授权服务器进行身份验证

无法在 SPNEGO 服务器上使用 requests-gssapi 进行身份验证

使用 Ajax 和 Postman 代码进行身份验证,但服务器无法识别变量。

使用Linux服务器对Windows设备进行身份验证是否可行/可行?

Blazor 服务器:针对 Identity Server 4 进行身份验证并使用 cookie 进行本地身份验证

无法对身份服务器 SSL 握手错误进行身份验证

使用服务帐户进行GCP服务器到服务器的身份验证

检查用户是否使用 PHP 在服务器上通过 Firebase 身份验证进行身份验证?

服务器不要求密钥进行身份验证

Firebase向后端服务器进行身份验证

Keycloak服务器身份验证

在身份服务器中使用cookie和令牌进行共享身份验证

使用 Blazor 服务器和 Azure AD 身份验证获取身份验证令牌

lua-如何向HTTPS服务器进行身份验证?