8000 🐛 Bug Report: SMTP username and password aren't validated when updating SMTP settings · Issue #9067 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
🐛 Bug Report: SMTP username and password aren't validated when updating SMTP settings #9067
Open
@stnguyen90

Description

@stnguyen90

👟 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:

$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Username = $username;
$mail->Password = $password;
$mail->Host = $host;
$mail->Port = $port;
$mail->SMTPSecure = $secure;
$mail->SMTPAutoTLS = false;
$mail->Timeout = 5;
try {
$valid = $mail->SmtpConnect();

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:

$mail->SMTPAuth = (!empty($username) && !empty($password));

🎲 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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersproduct / authFixes and upgrades for the Appwrite Auth / Users / Teams services.

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0