【发布时间】:2020-01-26 16:02:45
【问题描述】:
我正在使用虚拟分钟。我有一个有效的电子邮件帐户 no-reply@mydomain.com 我可以通过 webmin / virtual min 登录并发送电子邮件。
现在我想使用 nodemailer 从 node.js 发送邮件。
顺便说一句,这也适用于命令行。
mail -s "testing email" mygmail@gmail.com < /dev/null
这是我的 nodemailer 配置:
{
"smtp" : {
"host": "localhost",
"secure": false,
"auth": {
"user": "no-reply@mydomain.com",
"pass": "mypass"
},
"tls": {
"rejectUnauthorized": false
},
"debug" : true
},
"from" : "Resourceful Network <no-reply@resourcefulnetwork.nl>"
}
我在后缀配置文件中找到了以下配置:
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtp_tls_security_level = may
这都是由虚拟最小值设置的。
我收到这个错误
Error: Invalid login: 535 5.7.8 Error: authentication failed: authentication failure
code: 'EAUTH',
response: '535 5.7.8 Error: authentication failed: authentication failure',
responseCode: 535,
command: 'AUTH PLAIN'
我 100% 确定密码正确。
如果我在 nodemailer 配置中设置 "secure" : true 我会收到此错误
errno: 'ECONNREFUSED',
code: 'ESOCKET',
syscall: 'connect',
address: '127.0.0.1',
port: 465,
所以这似乎不是要走的路。
不确定要使用什么登录协议。我需要设置authMethod 吗? 安全还是不安全?
【问题讨论】:
标签: node.js email nodemailer postfix-mta