-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
File: utilities/mailer/index.js:62-68
Issue: The transporter.verify() callback returns an error object, but this return is inside a callback and doesn't prevent sendMail() from executing.
transporter.verify((error, success) => {
if (error) {
console.log("Error in SMTP configuration: ", error)
return {status: 500, message: error.toString()} // ❌ Lost return value
}
console.log("Server is ready to take our messages")
})
// Execution continues immediately to line 78
const info = await transporter.sendMail(mailOptions) // ❌ Sends anyway!Impact: Emails attempt to send even when SMTP server is unreachable, causing runtime errors.
Fix: Make verify async or check connection before sending:
await transporter.verify() // Throws on error
const info = await transporter.sendMail(mailOptions)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels