I was having the problem that outlook was showing the address that the email is from as:
user@server.domain.com; on behalf of; noreply@domain.com
in outlook, on the email pane the from address is correct, but when viewing the email it would show the above message.
To fix this, you can edit includes/class.misc.php and scroll to the very end.
There you will see the following:
/* Send email out after minor cleanups..*/
function sendmail($to, $subject, $message, $from, $headers = '') {
//TODO: provide an option to use SMTP server. Log all outgoign emails??
//do some cleanup...avoid stupid errors.
$to=preg_replace("/(\r\n|\r|\n)/s",'', trim($to));
$subject=preg_replace("/(\r\n|\r|\n)/s",'', trim($subject));
$message = preg_replace("/(\r\n|\r)/s", "\n", trim($message));
$headers = "From: $from \r\n" . $headers;
//echo "';
mail($to,$subject,$message,trim($headers));
}
You can change that to
/* Send email out after minor cleanups..*/
function sendmail($to, $subject, $message, $from, $headers = '') {
//TODO: provide an option to use SMTP server. Log all outgoign emails??
//do some cleanup...avoid stupid errors.
$to=preg_replace("/(\r\n|\r|\n)/s",'', trim($to));
$subject=preg_replace("/(\r\n|\r|\n)/s",'', trim($subject));
$message = preg_replace("/(\r\n|\r)/s", "\n", trim($message));
$headers = "From: $from \r\n" . $headers;
$headers = "Sender: $from \r\n" . $headers;
$headers = "X-Mailer: osTicket 1.6 \r\n" . $headers;
//echo "';
mail($to,$subject,$message,trim($headers));
}
The x-mailer header is simply for my own use, but adding the Sender: header fixes the display error.