【发布时间】:2023-03-27 14:39:02
【问题描述】:
我尝试开发我的 SMTP 服务器,为此我使用 Mailin 模块 - Mailin on GitHub
但是当我尝试对用户进行身份验证时,我的 Mailin SMTP 服务器返回 535 错误(身份验证凭据无效)。
我的带有选项的启动功能:
mailin.start({
port: 2525,
disableWebhook: true,
smtpOptions: {
banner: 'Hello Smtp Server',
logger: true,
requireAuthentication: true,
authMethods: ['PLAIN', 'LOGIN'],
disabledCommands: ['STARTTLS'],
ignoreTLS: true,
}
})
和我的用户身份验证事件监听器:
mailin.on('authorizeUser', function(connection, username, password, done) {
console.log(username, password);
done(null, true);
});
这是服务器日志:
info: Mailin Smtp server listening on port 2525
[2016-08-01 20:32:52] INFO: [Yl+t89fMiD31] Connection from [127.0.0.1]
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 220 MacBook-Air-Egor.local ESMTP ePost Smtp Server
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] C: ehlo MacBook-Air-Egor.local
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 250-MacBook-Air-Egor.local Nice to meet you, [127.0.0.1]
250-PIPELINING
250-8BITMIME
250-SMTPUTF8
250 AUTH PLAIN LOGIN
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] C: AUTH LOGIN
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 334 VXNlcm5hbWU6
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] C: YWJj
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 334 UGFzc3dvcmQ6
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] C: ZGVm
abc def
[2016-08-01 20:32:52] INFO: [Yl+t89fMiD31] Authentication failed for abc using LOGIN
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 535 Error: Authentication credentials invalid
[2016-08-01 20:32:52] INFO: [Yl+t89fMiD31] Authentication error for abc using LOGIN
Unauthorized user
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 535 Unauthorized user
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] C:
[2016-08-01 20:32:52] DEBUG: [Yl+t89fMiD31] S: 500 Error: command not recognized
[2016-08-01 20:32:52] INFO: [Yl+t89fMiD31] Connection closed to [127.0.0.1]
那么,我做错了什么,为什么会出现这个错误?
【问题讨论】:
-
您的错误可以自行解释。 “abc 的身份验证失败”。重新检查您的凭据并确保您拥有连接的所有访问权限。希望这会有所帮助。
-
@MykolaBorysyuk,你能说我,这个凭据在哪里配置?
-
我很确定这个库有一些要求。仔细阅读文档并找出他们需要的所有依赖项。 mailin.io/doc 。希望这会有所帮助。