summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2012-12-19 00:33:53 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2012-12-19 00:33:53 -0800
commitad497d23ec65dc8bf192097bbfc0b4241c74e7a0 (patch)
tree5ae677b09e7e330b330d9d6b688e491c21cdbb05 /core
parent7c5150ce32c54f927af900c492fcae802bed4b8e (diff)
parentd2828bab0792ce945f658e3fa66a62341c582d5e (diff)
downloadnextcloud-server-ad497d23ec65dc8bf192097bbfc0b4241c74e7a0.tar.gz
nextcloud-server-ad497d23ec65dc8bf192097bbfc0b4241c74e7a0.zip
Merge pull request #949 from RandolfCarter/InvalidDefaultAddress
Fixing default email sender address
Diffstat (limited to 'core')
-rw-r--r--core/ajax/share.php6
-rw-r--r--core/lostpassword/controller.php2
2 files changed, 2 insertions, 6 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 12206e0fd79..72ffc52e997 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -89,12 +89,8 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
if ($type === 'dir')
$text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($user, $file, $link));
- // handle localhost installations
- $server_host = OCP\Util::getServerHost();
- if ($server_host === 'localhost')
- $server_host = "example.com";
- $default_from = 'sharing-noreply@' . $server_host;
+ $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply');
$from_address = OCP\Config::getUserValue($user, 'settings', 'email', $default_from );
// send it out now
diff --git a/core/lostpassword/controller.php b/core/lostpassword/controller.php
index 523520dc754..e64b16d3b83 100644
--- a/core/lostpassword/controller.php
+++ b/core/lostpassword/controller.php
@@ -43,7 +43,7 @@ class OC_Core_LostPassword_Controller {
$tmpl->assign('link', $link, false);
$msg = $tmpl->fetchPage();
$l = OC_L10N::get('core');
- $from = 'lostpassword-noreply@' . OCP\Util::getServerHost();
+ $from = OCP\Util::getDefaultEmailAddress('lostpassword-noreply');
OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
echo('Mailsent');