nolimit-x 1.0.90 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sender.js +8 -37
package/package.json
CHANGED
package/src/sender.js
CHANGED
|
@@ -735,43 +735,14 @@ async function sendEmailViaRust(jobs, useRawSmtp) {
|
|
|
735
735
|
}
|
|
736
736
|
|
|
737
737
|
} catch (error) {
|
|
738
|
-
//
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
maxConnections: 5,
|
|
747
|
-
auth: { user: smtpConf.user, pass: smtpConf.pass }
|
|
748
|
-
});
|
|
749
|
-
const results = [];
|
|
750
|
-
for (const job of jobs) {
|
|
751
|
-
try {
|
|
752
|
-
const fromAddr = job.from || job.from_email;
|
|
753
|
-
const mailOptions = {
|
|
754
|
-
from: job.from_name ? `"${job.from_name}" <${fromAddr}>` : fromAddr,
|
|
755
|
-
to: job.to || job.to_email,
|
|
756
|
-
subject: job.subject,
|
|
757
|
-
html: job.body,
|
|
758
|
-
replyTo: job.reply_to,
|
|
759
|
-
priority: job.priority
|
|
760
|
-
};
|
|
761
|
-
if (job.custom_headers) mailOptions.headers = job.custom_headers;
|
|
762
|
-
if (job.attachments && job.attachments.length > 0) {
|
|
763
|
-
mailOptions.attachments = job.attachments.map(att => ({
|
|
764
|
-
filename: att.filename, content: att.content
|
|
765
|
-
}));
|
|
766
|
-
}
|
|
767
|
-
const info = await transporter.sendMail(mailOptions);
|
|
768
|
-
results.push({ success: true, message_id: info.messageId, error: null });
|
|
769
|
-
} catch (err) {
|
|
770
|
-
results.push({ success: false, message_id: null, error: err.message });
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
transporter.close();
|
|
774
|
-
return results;
|
|
738
|
+
// Do NOT fall back to nodemailer — opening more connections to the same
|
|
739
|
+
// server while Rust's may still be closing causes connection stacking.
|
|
740
|
+
console.error(`Rust backend failed: ${error.message}`);
|
|
741
|
+
return jobs.map(job => ({
|
|
742
|
+
success: false,
|
|
743
|
+
message_id: null,
|
|
744
|
+
error: `Backend failed: ${error.message}`
|
|
745
|
+
}));
|
|
775
746
|
}
|
|
776
747
|
}
|
|
777
748
|
|