From 1acbb8266014906367532da1d55ea5f800adb9eb Mon Sep 17 00:00:00 2001 From: mattpiwik Date: Mon, 19 Sep 2011 01:14:00 +0000 Subject: Refs #2327 last fix to noreply@localhost instead of proper domain in email from: in scheduled tasks git-svn-id: http://dev.piwik.org/svn/trunk@5186 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- core/Mail.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/Mail.php') diff --git a/core/Mail.php b/core/Mail.php index 8146db3218..6c9d323ce5 100644 --- a/core/Mail.php +++ b/core/Mail.php @@ -33,6 +33,14 @@ class Piwik_Mail extends Zend_Mail { $hostname = Zend_Registry::get('config')->mail->defaultHostnameIfEmpty; $piwikHost = Piwik_Url::getCurrentHost($hostname); + + // If known Piwik URL, use it instead of "localhost" + $piwikUrl = Piwik::getPiwikUrl(); + $url = parse_url($piwikUrl); + if(isset($url['host'])) + { + $piwikHost = $url['host']; + } $email = str_replace('{DOMAIN}', $piwikHost, $email); parent::setFrom($email, $name); } -- cgit v1.2.3