From 36aa4f4b74cf4af4f64b781c4a1c1d68c73ea00e Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Tue, 24 Sep 2013 23:26:39 +0400 Subject: [PATCH] Add initialization of 'sendmail_from' PHP variable This is a workaround for some systems that requires this variable to be set explicitly for sending emails (thanks to falcon for the issue) --- src/messenger/webim/libs/notify.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/messenger/webim/libs/notify.php b/src/messenger/webim/libs/notify.php index 95fda855..08d2da8c 100644 --- a/src/messenger/webim/libs/notify.php +++ b/src/messenger/webim/libs/notify.php @@ -45,7 +45,13 @@ function mibew_mail($toaddr, $reply_to, $subject, $body, $link) $body = preg_replace("/\n/", "\r\n", $body); log_notification($current_locale, "mail", $toaddr, $subject, $body, null, $link); + + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $mibew_mailbox); @mail($toaddr, $real_subject, wordwrap(myiconv($mibew_encoding, $mail_encoding, $body), 70), $headers); + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } } function mibew_xmpp($toaddr, $subject, $text, $link)