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