Closed tdhintz closed 3 years ago
Does your builder allow unsecure authentication? Take a look at issue #120 for some sample code. I think you need to either tell the sender authentication is not needed, support encryption on the connection, or support auth on non-secure connections.
I didn't specify that parameter. I rewrote as follows but the symptom appears unchanged.
/// <summary>
/// Start receiving messages.
/// </summary>
public void Start()
{
string server;
if (string.IsNullOrWhiteSpace(ServerName))
{
server = "localhost";
}
else
{
server = ServerName;
}
var options = new SmtpServerOptionsBuilder()
.ServerName(server)
.Port(Port)
.UserAuthenticator(new UserAuthenticator())
.MessageStore(new TestMessageStore())
.Endpoint(builder => builder
.Port(Port).AllowUnsecureAuthentication(true))
.Build();
var smtpServer = new SmtpServer.SmtpServer(options);
m_Receiver = smtpServer.StartAsync(m_CancelToken.Token);
}
I take that back. In the rewrite note that I specified .Port() twice which caused the service to report another failure. Strange that the Chilkat symptom looked the same. Removing the first, extra, .Port() allowed it to work. Briefly, AllowUnsecureAuthentication(true) fixed this problem. Thank you!
We integrated this services into our test harnesses as a way to validate emails sent by infrastructure. It performs great with the .Net SMTP client library but when that library is replaced with Chilkat's MailMan it can no longer authenticate. The log from Chilkat says it receives a 501 response. The folks at Chilkat simply pointed to the EHLO early in the conversation as an indication that SmtpServer 'has a bug'. Any insight is appreciated.