"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "srv/benno/bennoweb/htdocs/ctrl/a_forward.php" between
benno-web-2.8.9.tgz and benno-web-2.8.10.tgz

About: Open Benno (webapp) mail archiving solution (GUI and user-frontend; PHP5).

a_forward.php  (benno-web-2.8.9.tgz):a_forward.php  (benno-web-2.8.10.tgz)
skipping to change at line 52 skipping to change at line 52
try { try {
$rawMail = $Backend->fetchRaw($archive,$sessionMailId); $rawMail = $Backend->fetchRaw($archive,$sessionMailId);
// Linebreak in $rawMail must be \r\n. Otherwise the whole mail content // Linebreak in $rawMail must be \r\n. Otherwise the whole mail content
// (whith headers) will be send as mail body. // (whith headers) will be send as mail body.
$rawMail = preg_replace('/^Message-Id:/im','X-Benno-Resent-Message-Id:',$raw Mail); $rawMail = preg_replace('/^Message-Id:/im','X-Benno-Resent-Message-Id:',$raw Mail);
$msgIdHeader = 'Message-ID: <'.uniqid('',true).'@'.php_uname('n').'>'; $msgIdHeader = 'Message-ID: <'.uniqid('',true).'@'.php_uname('n').'>';
$send_to = escapeshellarg($mailTo); $send_to = escapeshellarg($mailTo);
$sendmail = "$sendmail_cmd -i -r $mail_from $send_to 2>&1"; $sendmail = "$sendmail_cmd -i -f $mail_from $send_to 2>&1";
$ph = popen($sendmail,'w');
if (!$ph) { throw new Exception("Cannot exec command \"$sendmail\""); } $fd = array(
$ret = fwrite($ph,$msgIdHeader."\r\n".$rawMail); 0 => array('pipe', 'r'),
if (!$ret) { 1 => array('pipe', 'w'),
fclose($ph); 2 => array('pipe', 'w')
throw new Exception("Cannot write mail to \"$sendmail\""); );
$process = proc_open($sendmail, $fd, $pipes);
if (is_resource($process)) {
// write "<username>$auth_sep<password>"
fwrite($pipes[0],$msgIdHeader."\r\n".$rawMail);
fclose($pipes[0]);
// read stdout from script
$outstring = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$errstring = stream_get_contents($pipes[2]);
fclose($pipes[2]);
$closevalue = proc_close($process);
if ($errstring) {
throw new Exception("Error send mail: $\"$errorvalue\" ($closevalue)
");
}
if ($App->getConfig('MAIL_LOG') == 'true') {
if ($outstring == '') {
$outstring = "Sent to $mailTo";
}
error_log("SENDMAIL: $outstring");
}
}
else {
throw new Exception("Cannot exec command \"$sendmail\"");
} }
fclose($ph);
$bennoId = QueryResult::getBennoId($sessionMailId); $bennoId = QueryResult::getBennoId($sessionMailId);
$Audit->log("MAIL $archive:".$bennoId.' >> '.$mailTo); $Audit->log("MAIL $archive:".$bennoId.' >> '.$mailTo);
} }
catch (Exception $e) { catch (Exception $e) {
$App->log('[a_forward] '.$e->getMessage()); $App->log('[a_forward] '.$e->getMessage());
} }
// no more output needed! // no more output needed!
exit; exit;
 End of changes. 2 change blocks. 
8 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)