louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
52.38k stars 4.72k forks source link

Auth failed login to SMTP server when special character in password #4789

Open nidasfly opened 1 month ago

nidasfly commented 1 month ago

⚠️ Please verify that this question has NOT been raised before.

🛡️ Security Policy

📝 Describe your problem

SMTP worked for Outlook months ago. But I updated Uptime Kuma, it failed to work. I reproduced this problem. Then I registered a new outlook email, with no character in the password, it sent email successfully.

📝 Error Message(s) or Log

image

🐻 Uptime-Kuma Version

1.23.13

💻 Operating System and Arch

fly.io

🌐 Browser

Chrome

🖥️ Deployment Environment

[build] image = 'louislam/uptime-kuma:1'

Vishnu-01-cyber commented 1 month ago

I am facing the same issue. Have you found any solution.

nidasfly commented 1 month ago

I am facing the same issue. Have you found any solution.

Sorry no, I am not a developer of uptime-kuma.

What I did for notify is I used another email, which only contains letters as password. Maybe you can try change the password to letters only?

CommanderStorm commented 1 month ago

Gmail SMTP

Could you have a look at https://github.com/louislam/uptime-kuma/issues/2928#issuecomment-1477648543 and see if you have enabled the app password properly?

Also given that the error message you showed could you make double sure that ALL fields (not just username and password, also DKIM, SMTP hostname/port/...) are identical? (We get a lot of issues from simple typos)

nidasfly commented 1 month ago

Yes with the gmail app pass, which has no special character, is working. But other email provider, like outlook, with special character in password, is not working. I've tested using python with the exact same config, it's working in python.

image

nidasfly commented 1 month ago

Gmail SMTP

Could you have a look at #2928 (comment) and see if you have enabled the app password properly?

Also given that the error message you showed could you make double sure that ALL fields (not just username and password, also DKIM, SMTP hostname/port/...) are identical? (We get a lot of issues from simple typos)

Hi, I register a new outlook email, with no special character in the password, and found out uptimekuma can send email with it. So the problem is located, the character in password is some how changed. However, I spent hours trying to find out where the code changed the password's special character, but failed. Could you please look into it?

CommanderStorm commented 1 month ago

The reason why you did not find a place where we chage the password is that it does not exist. I don't know what is happening with your email provider.

We just pass the username and password to nodemailer as you submitted it to the frontend...

The relevant code is:

https://github.com/louislam/uptime-kuma/blob/4df71af34f6e4333f5efb3178a71db885c2c3380/server/notification-providers/smtp.js#L38-L41 https://github.com/louislam/uptime-kuma/blob/4df71af34f6e4333f5efb3178a71db885c2c3380/src/components/notifications/SMTP.vue#L38-L46

Maybe a similar case as reported here?

nidasfly commented 1 month ago

Maybe a similar case as reported here?

Can you please try any email with password including special character like "?" or "!"

CommanderStorm commented 1 month ago

Yes, but that is not the issue.. => please check the rest of your config for typos and retry again. Depending on your email provider you might also need to activate smtp or hop through additional steps like you have to do for Gmail, GMX or similar..

nidasfly commented 1 month ago

OK then I don't know what is the problem. It seems only happen to Outlook. I did check the config for thoughsand times, and tested it with python.