Added support for mail() inside chroots
This commit is contained in:
16
var/www/mail/index.php
Normal file
16
var/www/mail/index.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$head = true;
|
||||
$content = str_replace("\r\n", "\n", $_POST['content']);
|
||||
$lines = explode("\n", $content);
|
||||
$mail = '';
|
||||
foreach($lines as $line){
|
||||
if($head && stripos(ltrim($line), 'FROM')===0){
|
||||
continue;
|
||||
}
|
||||
if($head && $line===''){
|
||||
$head = false;
|
||||
$mail .= "From: $_SERVER[MAIL_USER]\r\n";
|
||||
}
|
||||
$mail .= "$line\r\n";
|
||||
}
|
||||
exec('echo ' . escapeshellarg($mail). ' | sendmail -t -f ' . $_SERVER['MAIL_USER']);
|
Reference in New Issue
Block a user