nolimit-x 1.0.74 → 1.0.76
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 +30 -14
- package/templates/config.json +1 -0
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
|
@@ -209,7 +209,7 @@ async function send(options) {
|
|
|
209
209
|
// Format license expiry as a countdown instead of a raw date
|
|
210
210
|
const _expiresMs = new Date(licenseResult.info.expires).getTime() - Date.now();
|
|
211
211
|
const _days = Math.floor(_expiresMs / 86400000);
|
|
212
|
-
const _hrs
|
|
212
|
+
const _hrs = Math.floor((_expiresMs % 86400000) / 3600000);
|
|
213
213
|
const _mins = Math.floor((_expiresMs % 3600000) / 60000);
|
|
214
214
|
const _secs = Math.floor((_expiresMs % 60000) / 1000);
|
|
215
215
|
const _countdown = `${_days}d ${_hrs}h ${_mins}m ${_secs}s`;
|
|
@@ -272,13 +272,26 @@ async function send(options) {
|
|
|
272
272
|
// SMTP
|
|
273
273
|
// ═══════════════════════════════════════════════════════
|
|
274
274
|
const smtpConf = configManager.smtpConfig;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
275
|
+
const _smtpArr = configManager.smtpConfigs && configManager.smtpConfigs.length > 1
|
|
276
|
+
? configManager.smtpConfigs
|
|
277
|
+
: (Array.isArray(configManager.config.smtp) ? configManager.config.smtp : [configManager.config.smtp]);
|
|
278
|
+
const _smtpRotation = configManager.config.configurations?.system?.smtp_rotation === true && _smtpArr.length > 1;
|
|
279
|
+
|
|
280
|
+
if (_smtpRotation) {
|
|
281
|
+
console.log(`\n${GREEN}SMTP Rotation {${RESET}`);
|
|
282
|
+
_smtpArr.forEach((s, i) => {
|
|
283
|
+
console.log(` ${WHITE}[${i + 1}]${RESET} ${GREEN}${s.host}:${s.port}${RESET} ${WHITE}User:${RESET} ${GREEN}${utils.maskEmail(s.user || '')}${RESET}`);
|
|
284
|
+
});
|
|
285
|
+
console.log(`${GREEN}}${RESET}`);
|
|
286
|
+
} else {
|
|
287
|
+
console.log(`\n${GREEN}SMTP {${RESET}`);
|
|
288
|
+
console.log(` ${WHITE}Host:${RESET} ${GREEN}${smtpConf.host}${RESET}`);
|
|
289
|
+
console.log(` ${WHITE}Port:${RESET} ${GREEN}${smtpConf.port}${RESET}`);
|
|
290
|
+
console.log(` ${WHITE}Secure:${RESET} ${GREEN}${smtpConf.secure !== undefined ? smtpConf.secure : true}${RESET}`);
|
|
291
|
+
console.log(` ${WHITE}User:${RESET} ${GREEN}${utils.maskEmail(smtpConf.user || '')}${RESET}`);
|
|
292
|
+
console.log(` ${WHITE}Pass:${RESET} ***`);
|
|
293
|
+
console.log(`${GREEN}}${RESET}`);
|
|
294
|
+
}
|
|
282
295
|
|
|
283
296
|
// ═══════════════════════════════════════════════════════
|
|
284
297
|
// ACTIVE FEATURES
|
|
@@ -287,6 +300,7 @@ async function send(options) {
|
|
|
287
300
|
const useRawSmtp = conf.raw_smtp || false;
|
|
288
301
|
let activeFeatures = [];
|
|
289
302
|
if (useRawSmtp) activeFeatures.push('Raw SMTP');
|
|
303
|
+
if (_smtpRotation) activeFeatures.push('SMTP Rotation');
|
|
290
304
|
if (conf.agent && conf.agent.is_multi_thread) activeFeatures.push('Thread');
|
|
291
305
|
if (conf.system && conf.system.turbo_mode) activeFeatures.push('Turbo Mode');
|
|
292
306
|
if (conf.use_attachment) activeFeatures.push('Attachment');
|
|
@@ -479,10 +493,15 @@ async function send(options) {
|
|
|
479
493
|
}
|
|
480
494
|
|
|
481
495
|
|
|
496
|
+
if (_smtpRotation) {
|
|
497
|
+
for (let i = 0; i < allJobs.length; i++) {
|
|
498
|
+
const rotatedSmtp = _smtpArr[i % _smtpArr.length];
|
|
499
|
+
allJobs[i].smtp = [rotatedSmtp]; // Rust reads smtp[0]
|
|
500
|
+
allJobs[i].from = rotatedSmtp.user; // envelope sender matches SMTP auth
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
482
504
|
|
|
483
|
-
// ═══════════════════════════════════════════════════════
|
|
484
|
-
// SEND ALL AT ONCE (Rust handles connection pooling)
|
|
485
|
-
// ═══════════════════════════════════════════════════════
|
|
486
505
|
let totalSent = 0;
|
|
487
506
|
|
|
488
507
|
if (allJobs.length > 0) {
|
|
@@ -517,7 +536,6 @@ async function send(options) {
|
|
|
517
536
|
const elapsedMs = stats.duration;
|
|
518
537
|
const elapsedSec = (elapsedMs / 1000).toFixed(2);
|
|
519
538
|
|
|
520
|
-
// Total emails loaded by the campaign (already filtered, correct count)
|
|
521
539
|
const emailsTxtCount = configManager.emailList.length;
|
|
522
540
|
|
|
523
541
|
const now = new Date();
|
|
@@ -543,14 +561,12 @@ async function send(options) {
|
|
|
543
561
|
}
|
|
544
562
|
|
|
545
563
|
function getRandomizedDelay(baseDelay) {
|
|
546
|
-
// Randomize delay by ±20%
|
|
547
564
|
const min = Math.floor(baseDelay * 0.8);
|
|
548
565
|
const max = Math.ceil(baseDelay * 1.2);
|
|
549
566
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
550
567
|
}
|
|
551
568
|
|
|
552
569
|
function getRandomBatchSize() {
|
|
553
|
-
// Random batch size between 5 and 15
|
|
554
570
|
return Math.floor(Math.random() * 11) + 5;
|
|
555
571
|
}
|
|
556
572
|
|