diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-09-19 05:14:00 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-09-19 05:14:00 +0400 |
commit | 1acbb8266014906367532da1d55ea5f800adb9eb (patch) | |
tree | a79e2a2632565224fbc6ea94fe2a812531f804e5 /core/Mail.php | |
parent | e144773deedd5066f179c8425cc2beb1fb003996 (diff) |
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
Diffstat (limited to 'core/Mail.php')
-rw-r--r-- | core/Mail.php | 8 |
1 files changed, 8 insertions, 0 deletions
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); } |