Hi there!
I’ve setup a yandex mail account to use instead of sendmail as provided with peertube docker installation (Docker guide | PeerTube documentation) but it’s not working.
Whenever an email needs to be sent (notifications, about form, etc.) by peertube, I get an error message like this:
peertube1.log:{"err":{"stack":"Error: Greeting never received\n at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)\n at SMTPConnection._onError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:776:20)\n at Timeout.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:710:22)\n at listOnTimeout (node:internal/timers:559:17)\n at processTimers (node:internal/timers:502:7)","message":"Greeting never received","code":"ETIMEDOUT","command":"CONN"},"level":"error","message":"Error in email sender.","label":"soberanatv.mooo.com:443","timestamp":"2023-04-28T12:58:32.350Z"}
I’ve setup some test code to run nodemailer (the lib used by peertube) to try to reproduce the error:
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
direct: true,
host: 'smtp.yandex.com',
port: 465,
ignoreTLS: false,
auth: {
user: '[my user name]',
pass: '[my app password, a yandex thing]'
},
secure: true
});
var mailOptions = {
from: '[my from email]',
to: '[to some email]',
subject: 'Teste de envio de emails usando nodemailer com variações',
text: 'Este email é um teste de envio de emails usando nodemailer rodando diretamente no paranauê lá.'
};
transporter.sendMail(mailOptions, function (error, info) {
if (error) {
return console.log(error);
}
console.log("Message sent " + info.response)
});
The error Greeting never received
only happens when the option secure
is set to false in my test code. Peertube maps the docker environment variable PEERTUBE_SMTP_TLS
to this option I’ve mentioned, so I think this is not the problem.
I’m running my peertube instance behind a nginx proxy which is on another machine. I don’t know if this can be the source for this problem, just sharing in case it helps pointing out the cause of this issue.