nolimit-x 1.0.75 → 1.0.77
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/processor.js +0 -2
- package/src/sender.js +5 -6
package/package.json
CHANGED
package/src/processor.js
CHANGED
|
@@ -49,7 +49,6 @@ class ConfigManager {
|
|
|
49
49
|
console.warn('SMTP rotation enabled but no providers found in smtps.txt, falling back to config.json');
|
|
50
50
|
this.smtpConfig = this.config.smtp[0];
|
|
51
51
|
} else {
|
|
52
|
-
console.log(`Loaded ${this.smtpConfigs.length} SMTP providers for rotation`);
|
|
53
52
|
this.smtpConfig = this.smtpConfigs[0]; // Default to first provider
|
|
54
53
|
}
|
|
55
54
|
} else {
|
|
@@ -78,7 +77,6 @@ class ConfigManager {
|
|
|
78
77
|
const providers = JSON.parse(content);
|
|
79
78
|
|
|
80
79
|
if (Array.isArray(providers) && providers.length > 0) {
|
|
81
|
-
console.log(`Loaded ${providers.length} SMTP providers for rotation`);
|
|
82
80
|
return providers;
|
|
83
81
|
} else {
|
|
84
82
|
console.warn('SMTP providers file contains invalid JSON or empty array');
|
package/src/sender.js
CHANGED
|
@@ -272,7 +272,9 @@ async function send(options) {
|
|
|
272
272
|
// SMTP
|
|
273
273
|
// ═══════════════════════════════════════════════════════
|
|
274
274
|
const smtpConf = configManager.smtpConfig;
|
|
275
|
-
const _smtpArr =
|
|
275
|
+
const _smtpArr = configManager.smtpConfigs && configManager.smtpConfigs.length > 1
|
|
276
|
+
? configManager.smtpConfigs
|
|
277
|
+
: (Array.isArray(configManager.config.smtp) ? configManager.config.smtp : [configManager.config.smtp]);
|
|
276
278
|
const _smtpRotation = configManager.config.configurations?.system?.smtp_rotation === true && _smtpArr.length > 1;
|
|
277
279
|
|
|
278
280
|
if (_smtpRotation) {
|
|
@@ -491,12 +493,9 @@ async function send(options) {
|
|
|
491
493
|
}
|
|
492
494
|
|
|
493
495
|
|
|
494
|
-
|
|
495
|
-
const smtpRotationEnabled = conf.system?.smtp_rotation === true && smtpArray.length > 1;
|
|
496
|
-
|
|
497
|
-
if (smtpRotationEnabled) {
|
|
496
|
+
if (_smtpRotation) {
|
|
498
497
|
for (let i = 0; i < allJobs.length; i++) {
|
|
499
|
-
const rotatedSmtp =
|
|
498
|
+
const rotatedSmtp = _smtpArr[i % _smtpArr.length];
|
|
500
499
|
allJobs[i].smtp = [rotatedSmtp]; // Rust reads smtp[0]
|
|
501
500
|
allJobs[i].from = rotatedSmtp.user; // envelope sender matches SMTP auth
|
|
502
501
|
}
|