Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid login sequence while waiting for server challenge string: 504 5.7.4 Unrecognized authentication type #2

Open
heresmyusername opened this issue Apr 17, 2023 · 0 comments

Comments

@heresmyusername
Copy link

Hello, I am trying to user a 3rd party program which uses nodemailer to send emails with Microsoft Exchange. When I try to send an email, the API log says "Invalid login sequence while waiting for server challenge string: 504 5.7.4 Unrecognized authentication type". Please could someone help me understand why this is happening and how I can fix it? Below is the code:

// NTLM support: https://github.com/nodemailer/nodemailer-ntlm-auth
// Steps:
// 1) run "npm install nodemailer-ntlm-auth" in "echo $(countly dir)"
// 2) rename or copy this file to countly/extend/mail.js

var nodemailer = require("nodemailer");
var nodemailerNTLMAuth = require("nodemailer-ntlm-auth");

module.exports = function(mail) {
mail.smtpTransport = nodemailer.createTransport({
host: 'smtp.office365.com',
port: 587,
auth: {
type: 'custom',
method: 'NTLM',
user: user,
pass: pass,
},
customAuth: {
NTLM: nodemailerNTLMAuth
}
});

mail.sendMail = function(message, callback) {
message.from = from;
mail.smtpTransport.sendMail(message, function(error) {
if (error) {
console.log("Error sending email");
console.log(error.message);
}

if (callback) {
callback(error);
}
});
};
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant