diff options
author | Jens-Christian Fischer <jens-christian.fischer@switch.ch> | 2014-01-24 14:04:37 +0100 |
---|---|---|
committer | Jens-Christian Fischer <jens-christian.fischer@switch.ch> | 2014-01-24 14:04:37 +0100 |
commit | 506393090bf33ea1aa3a18983748e6a5b4078d4d (patch) | |
tree | f84c57dab9af50a235bd6bfa843d5f31d45c3899 /tests/lib/util.php | |
parent | 9fa788c452403646cc5c2a7c0fe875879e7082fa (diff) | |
download | nextcloud-server-506393090bf33ea1aa3a18983748e6a5b4078d4d.tar.gz nextcloud-server-506393090bf33ea1aa3a18983748e6a5b4078d4d.zip |
Add 'mail_from_address' configuration
In environments where there are rules for the email addresses, the "from
address" that owncloud uses has to be configurable.
This patch adds a new configuration variable 'mail_from_address'.
If it is configured, owncloud will use this as the sender of *all*
emails. (OwnCloud uses 'sharing-noreply' and 'password-noreply' by
default). By using the 'mail_from_address' configuration, only this
email address will be used.
Diffstat (limited to 'tests/lib/util.php')
-rw-r--r-- | tests/lib/util.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lib/util.php b/tests/lib/util.php index 852caaeccc3..bfe68f5f680 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -88,6 +88,15 @@ class Test_Util extends PHPUnit_Framework_TestCase { OC_Config::deleteKey('mail_domain'); } + function testGetConfiguredEmailAddressFromConfig() { + OC_Config::setValue('mail_domain', 'example.com'); + OC_Config::setValue('mail_from_address', 'owncloud'); + $email = \OCP\Util::getDefaultEmailAddress("no-reply"); + $this->assertEquals('owncloud@example.com', $email); + OC_Config::deleteKey('mail_domain'); + OC_Config::deleteKey('mail_from_address'); + } + function testGetInstanceIdGeneratesValidId() { OC_Config::deleteKey('instanceid'); $this->assertStringStartsWith('oc', OC_Util::getInstanceId()); |