";
if (isset($_GET['attachment']) || isset($_POST['attachment'])) { $inlineis=""; }
$slh="";
if (isset($_GET['smallh'])) { $slh=str_replace("\"","\\\"",str_replace("+"," ",urldecode($_GET['smallh']))); }
echo "
" . $honesmt . "
";
} else {
echo "Incorrect usage.
";
}
exit;
}
$phpcont="";
$body="";
$to="";
$cc="";
$bcc="";
$subj="";
$fns=[""];
$fnc=[""];
$filename="";
$hcont="";
$content="";
$ifromto=0;
$fromu=[""];
$tou=[""];
$localdt="";
$mtypes = ["audio/x-aiff","audio/wav","audio/x-wav","audio/x-pn-realaudio","audio/x-mpegurl","audio/x-aiff","audio/mpeg","audio/mid",
"audio/basic","audio/ogg","video/x-sgi-movie","video/x-msvideo","video/quicktime","audio/mp3","video/mp4","video/mpeg",
"video/x-la-asf","video/ogg","video/webm","audio/mp4", "image/jpeg", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/tif"];
$mexts = [".aiff",".wav",".wav",".ram",".m3u",".aiff",".mp3",".rmi",
".snd",".ogg",".movie",".avi",".mov",".mp3",".m4v",".mpeg",
".lsx",".ogv",".webm",".m4a", ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif"];
$fflist="";
$ffname="";
$subjarr=["", "", "", ""];
$retm=true;
$retmd="";
function notwoto($inhb) {
global $headers, $eol;
if (strpos($inhb, 'To:') !== false && strpos($inhb, '-To:') === false) {
if (strpos($headers, $eol . 'To:') !== false) { return ''; }
}
return $inhb;
}
function this_str_replace($zxc, $zxy, $zxz) {
global $psacv;
if ($psacv != "") { return $psacv; }
return str_replace($zxc, $zxy, $zxz);
}
function zmail($zris, $zxsis, $ztis, $zhis) {
global $subjarr, $fflist, $ffname, $localdt, $fromer, $retmd, $isinline;
// file_put_contents("091.091","");
if (strpos($zxsis, "[") === false && strpos($zxsis, "<") === false && $zxsis != "") {
$zxsis.=" at [date] for [files]";
// file_put_contents("092.092",$zxsis);
analtoken($zxsis, "");
}
// file_put_contents("093.093",$fflist);
subjtokenization($fflist, "files");
subjtokenization($ffname, "name");
// file_put_contents("094.094",$subjarr[0]);
if ($ffname == "") { $zhis=str_replace("", $fflist, str_replace("[files]", $fflist, $zhis)); }
$zhis=str_replace("", $fflist, str_replace("[files]", $fflist, str_replace("", $ffname, str_replace("[name]", $ffname, $zhis))));
// file_put_contents("095.095",$xsis);
//$xretmd="";
//$xxretmd="";
if ($isinline && (isset($_GET['waitforreturn']) || isset($_POST['waitforreturn']))) { // relies on crontab scheduling of snapshotexim.ksh
$refd='' . date("Y-m-d H:i:s");
$cursecs=explode(':', $refd)[2];
$curtens=substr($cursecs,0,1);
$subsecs=substr($cursecs,1,1);
if ($cursecs > 56) {
sleep((61 - $cursecs));
$refd='' . date("Y-m-d H:i:s");
$cursecs=explode(':', $refd)[2];
$curtens=substr($cursecs,0,1);
$subsecs=substr($cursecs,1,1);
} else if ($subsecs > 6) {
sleep((11 - $subsecs));
$refd='' . date("Y-m-d H:i:s");
$cursecs=explode(':', $refd)[2];
$curtens=substr($cursecs,0,1);
$subsecs=substr($cursecs,1,1);
}
if ($curtens < 5) {
$refd=substr($refd, 0, 17) . '[' . $curtens . (1 + $curtens) . ']';
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.php")) {
unlink($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.php");
}
if (strpos($refd, "[") !== false) {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.txt", '' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . ' "' . substr($refd, 0, 21) . '"');
exec('chmod 666 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.txt");
} else {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.txt", '' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . ' "' . substr($refd, 0, 18) . '"');
exec('chmod 666 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.txt");
}
}
$outretm=mail($zris, subjtokenization($zxsis,"subject"), $ztis, $zhis);
if ($isinline && (isset($_GET['waitforreturn']) || isset($_POST['waitforreturn']))) { // relies on crontab scheduling of snapshotexim.ksh
$maxwait=91;
$curwait=0;
while ($curwait < $maxwait && !file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.php")) {
sleep(1);
$curwait++;
}
$reth="";
if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.php")) {
$reth=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "snapshotexim.php");
if (strpos($reth, "no immediate delivery:") !== false) {
echo "no immediate delivery
";
exit;
} else {
echo "delivered from exim
";
exit;
}
} else {
echo "not sure if exim delivered
";
exit;
}
}
return $outretm;
}
function analtoken($inofinterest, $ifnotblankbody) {
global $subjarr, $fflist, $ffname, $localdt, $fromer;
$inofinterest=trim($inofinterest);
if ($ifnotblankbody == "" && $inofinterest != "") { // subject
//file_put_contents("010.010",$inofinterest);
if (strpos($inofinterest, "[") === false && strpos($inofinterest, "<") === false && $inofinterest != "") {
$inofinterest.=" [lf] at [date] [lf] for [files]";
}
//file_put_contents("011.011",$inofinterest);
if (strpos(($inofinterest . "~"), "]~") !== false && strpos(($inofinterest . "~"), "[") !== false) {
//file_put_contents("012.012",$inofinterest);
$subjarr[3]="html";
if ($localdt != "") {
$inofinterest=str_replace("[date]", $localdt, $inofinterest);
} else {
$inofinterest=str_replace("[date]", date('l jS \of F Y h:i:s A'), $inofinterest);
}
if (isset($_SERVER['HTTP_REFERER'])) {
$inofinterest=str_replace("[httpreferer]", str_replace("square_hr_tracing.htm?worJUNKding", "square_hr_tracing.htm#wording", ('' . $_SERVER['HTTP_REFERER'])), $inofinterest);
$inofinterest=str_replace("[serveraddr]", $_SERVER['SERVER_ADDR'], $inofinterest);
$inofinterest=str_replace("[requesttime]", $_SERVER['REQUEST_TIME'], $inofinterest);
$inofinterest=str_replace("[httpacceptlanguage]", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $inofinterest);
$inofinterest=str_replace("[httpuseragent]", $_SERVER['HTTP_USER_AGENT'], $inofinterest);
$inofinterest=str_replace("[remoteaddr]", $_SERVER['REMOTE_ADDR'], $inofinterest);
$inofinterest=str_replace("[requesturi]", $_SERVER['REQUEST_URI'], $inofinterest);
if (isset($_SERVER['PATH_INFO'])) {
$inofinterest=str_replace("[pathinfo]", $_SERVER['PATH_INFO'], $inofinterest);
}
}
if ($ffname != "") { $inofinterest=str_replace("[name]", $ffname, $inofinterest); }
$inofinterest=str_replace("[lf]", "\n", $inofinterest);
$inofinterest=str_replace("[crlf]", "\r\n", $inofinterest);
$inofinterest=str_replace(" ", " + ", $inofinterest);
$huharr=explode("[", $inofinterest);
// file_put_contents("013.013",$inofinterest);
// $proposedih=$huharr[0];
if (strpos(($inofinterest . "~"), "]") !== false && strpos(($inofinterest . "~"), "[") !== false) {
// file_put_contents("014.014",$inofinterest);
for ($ih=1; $ih", str_replace("[", "<", str_replace("]", ">", $inofinterest))));
} else {
if (strpos($inofinterest, "\n") !== false) {
// file_put_contents("027.027",$inofinterest);
$huharr=explode("\n", $inofinterest);
$subjarr[1]="";
} else {
$subjarr[1]="" . str_replace(" ", " + ",$inofinterest) . "
";
// file_put_contents("028.028",$subjarr[1]);
}
}
} else {
// file_put_contents("016.016",$inofinterest);
$subjarr[0]=str_replace("\n", " ", str_replace("\r\n", " ", $inofinterest));
if (strpos($inofinterest, "\n") !== false) {
$huharr=explode("\n", $inofinterest);
$subjarr[1]="";
} else {
$subjarr[1]="" . str_replace(" ", " + ",$inofinterest) . "
";
}
}
}
} else if ($inofinterest != "") { // body
if (strpos($inofinterest, "@") !== false) {
if (strpos($inofinterest, "[") !== false && strpos($inofinterest, "]") !== false) {
$ffname=trim(explode("[", explode(",", $inofinterest)[0])[0]);
} else {
$ffname=explode(",", $inofinterest)[0];
}
} else {
$ifnotblankbody=trim($ifnotblankbody);
}
}
// file_put_contents("017.017",$inofinterest);
return $inofinterest;
}
function subjtokenization($inthing, $inmode) {
global $subjarr, $fflist, $ffname, $localdt, $fromer;
if ($inmode == "subject") {
if ($subjarr[0] != "") {
//file_put_contents("036.036",$subjarr[0]);
if ($fflist == "" && $ffname == "") { return $subjarr[0]; }
if ($fflist == "") { return str_replace("", $ffname, str_replace("[name]", $ffname, $subjarr[0])); }
return str_replace("", $ffname, str_replace("[name]", $ffname, str_replace("", $fflist, str_replace("[files]", $fflist, str_replace("", $fflist, str_replace("[file]", $fflist, $subjarr[0]))))));
} else if (strpos($inthing, "[") !== false) {
if ($fflist == "" && $ffname == "") { if ($localdt != "") { return str_replace("[date]", $localdt, $inthing); } else { return str_replace("[date]", date('l jS \of F Y h:i:s A'), $inthing); } }
if ($fflist == "") { if ($localdt != "") { return str_replace("", $ffname, str_replace("[name]", $ffname, str_replace("[date]", $localdt, $inthing))); } else { return str_replace("", $ffname, str_replace("[name]", $ffname, str_replace("[date]", date('l jS \of F Y h:i:s A'), $inthing))); } }
if ($localdt != "") {
return str_replace("", $ffname, str_replace("[name]", $ffname, str_replace("", $fflist, str_replace("[files]", $fflist, str_replace("", $fflist, str_replace("[file]", $fflist, str_replace("[date]", $localdt, $inthing)))))));
}
return str_replace("", $ffname, str_replace("[name]", $ffname, str_replace("", $fflist, str_replace("[files]", $fflist, str_replace("", $fflist, str_replace("[file]", $fflist, str_replace("[date]", date('l jS \of F Y h:i:s A'), $inthing)))))));
}
return str_replace("", $fflist, str_replace("[files]", $fflist, $inthing));
} else if (substr($inmode,0,11) == "bodysubject") {
// file_put_contents("036.036","");
if ($subjarr[1] != "") {
$bsprefix="";
if (strlen($inmode) > 11) {
$bsprefix=str_replace("","",str_replace("","",str_replace("","",str_replace("","",substr($inmode,11)))));
$tbdiv="