appwrite: 🐛 Bug Report: SMTP username and password aren't validated when updating SMTP settings

👟 Reproduction steps

  1. Update a project’s SMTP settings
  2. Use a valid host, port, and secure protocol, but an incorrect username and password
  3. Click Update

👍 Expected behavior

The update should fail because the username and password are incorrect.

👎 Actual Behavior

The SMTP settings are updated successfully.

We use $mail->SmtpConnecti() test the connection:

https://github.com/appwrite/appwrite/blob/8e021158286cd04b64b391afe86975e23368a52c/app/controllers/api/projects.php#L1684-L1695

However, because SMTPAuth isn’t set to true, the username and password are not checked.

We need to set SMTPAuth like we do in the worker:

https://github.com/appwrite/appwrite/blob/8e021158286cd04b64b391afe86975e23368a52c/src/Appwrite/Platform/Workers/Mails.php#L166

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn’t find similar issue

🏢 Have you read the Code of Conduct?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 22 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@StarTrooper08, assigned! Thanks for your interest! 🙏🏼