From f2531e7ee7e98d96c750e1e7067c208362c8e977 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 11 Oct 2008 14:25:29 +0200 Subject: pass envelope headers to sendmail on Unix systems FS#1419 FS#1375 This patch will pass the from and to headers to the sendmail binary, when sending mails. This needs heavy testing. darcs-hash:20081011122529-7ad00-db97a65eecf29a21a40abe9280b33a76cac58aec.gz --- inc/mail.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'inc') diff --git a/inc/mail.php b/inc/mail.php index 1f4acf346..5cd7db13d 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -71,6 +71,12 @@ function _mail_send_action($data) { // No named recipients for To: in Windows (see FS#652) $usenames = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? false : true; + // On Unix set the envelope headers correctly: + if($usenames){ + if($from) $params = ((string) $params).' -f '.escapeshellarg($from); + if($to) $params = ((string) $params).' '.escapeshellarg($to); + } + $to = mail_encode_address($to,'',$usenames); $header .= mail_encode_address($from,'From'); $header .= mail_encode_address($cc,'Cc'); -- cgit v1.2.3