summaryrefslogtreecommitdiff
path: root/inc/mail.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-10-11 14:25:29 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-10-11 14:25:29 +0200
commitf2531e7ee7e98d96c750e1e7067c208362c8e977 (patch)
tree0ca6eebab61aa2c9712e6030e01d82c96e899987 /inc/mail.php
parente9621d076ac44caa609c6de79fe7f22a38f6a450 (diff)
downloadrpg-f2531e7ee7e98d96c750e1e7067c208362c8e977.tar.gz
rpg-f2531e7ee7e98d96c750e1e7067c208362c8e977.tar.bz2
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
Diffstat (limited to 'inc/mail.php')
-rw-r--r--inc/mail.php6
1 files changed, 6 insertions, 0 deletions
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');