diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 865f17b..f2645f8 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1133,7 +1133,8 @@ function user_account_form_validate($form, &$form_state) {
 
   $mail = $form_state['values']['mail'];
 
-  if ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($mail), 'LIKE')->range(0, 1)->execute()->fetchField()) {
+  // Validate the e-mail address, and check if it is taken by an existing user.
+  if (variable_get('user_mail_unique', TRUE) && (bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($mail), 'LIKE')->range(0, 1)->execute()->fetchField()) {
     // Format error message dependent on whether the user is logged in or not.
     if ($GLOBALS['user']->uid) {
       form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $mail)));
diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc
index c54bd4c..4c91cb1 100644
--- a/core/modules/user/user.pages.inc
+++ b/core/modules/user/user.pages.inc
@@ -56,15 +56,13 @@ function user_pass() {
 function user_pass_validate($form, &$form_state) {
   $name = trim($form_state['values']['name']);
   // Try to load by email.
-  $users = user_load_multiple(array(), array('mail' => $name, 'status' => '1'));
-  $account = reset($users);
-  if (!$account) {
+  $accounts = user_load_multiple(array(), array('mail' => $name, 'status' => '1'));
+  if (!$accounts) {
     // No success, try to load by name.
-    $users = user_load_multiple(array(), array('name' => $name, 'status' => '1'));
-    $account = reset($users);
+    $accounts = user_load_multiple(array(), array('name' => $name, 'status' => '1'));
   }
-  if (isset($account->uid)) {
-    form_set_value(array('#parents' => array('account')), $account, $form_state);
+  if ($accounts) {
+    form_set_value(array('#parents' => array('accounts')), $accounts, $form_state);
   }
   else {
     form_set_error('name', t('Sorry, %name is not recognized as a user name or an e-mail address.', array('%name' => $name)));
@@ -74,11 +72,17 @@ function user_pass_validate($form, &$form_state) {
 function user_pass_submit($form, &$form_state) {
   global $language_interface;
 
-  $account = $form_state['values']['account'];
-  // Mail one time login URL and instructions using current language.
-  $mail = _user_mail_notify('password_reset', $account, $language_interface);
-  if (!empty($mail)) {
-    watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
+  $accounts = $form_state['values']['accounts'];
+  $any_mail = FALSE;
+  foreach ($accounts as $account) {
+    // Mail one time login URL and instructions using current language.
+    $mail = _user_mail_notify('password_reset', $account, $language_interface);
+    if (!empty($mail)) {
+      $any_mail = TRUE;
+      watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
+    }
+  }
+  if ($any_mail) {
     drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
   }
 
diff --git a/core/modules/user/user.test b/core/modules/user/user.test
index 3a07e1c..b3f11aa 100644
--- a/core/modules/user/user.test
+++ b/core/modules/user/user.test
@@ -121,6 +121,8 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
     $edit = array();
     $edit['name'] = $this->randomName();
     $edit['mail'] = $duplicate_user->mail;
+    $edit['pass[pass1]'] = $new_pass = $this->randomName();
+    $edit['pass[pass2]'] = $new_pass;
 
     // Attempt to create a new account using an existing e-mail address.
     $this->drupalPost('user/register', $edit, t('Create new account'));
@@ -131,6 +133,15 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
 
     $this->drupalPost('user/register', $edit, t('Create new account'));
     $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying a duplicate email address with added whitespace displays an error message'));
+
+    // Allow multiple accounts to use the same e-mail address.
+    variable_set('user_mail_unique', FALSE);
+
+    // Create new user with original e-mail addresss.
+    $edit['mail'] = $duplicate_user->mail;
+
+    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->assertText(t('Registration successful. You are now logged in.'), t('Users are logged in after registering.'));
   }
 
   function testRegistrationDefaultValues() {
@@ -1693,6 +1704,19 @@ class UserEditTestCase extends DrupalWebTestCase {
     $this->drupalPost("user/$user1->uid/edit", $edit, t('Save'));
     $this->assertRaw(t('The name %name is already taken.', array('%name' => $edit['name'])));
 
+    // Test that error message appears when attempting to use a non-unique
+    // e-mail address.
+    $edit = array();
+    $edit['mail'] = $user2->mail;
+    $edit['current_pass'] = $user1->pass_raw;
+    $this->drupalPost("user/$user1->uid/edit", $edit, t('Save'));
+    $this->assertRaw(t('The e-mail address %email is already taken.', array('%email' => $edit['mail'])));
+
+    // Allow multiple accounts to use the same e-mail address.
+    variable_set('user_mail_unique', FALSE);
+    $this->drupalPost("user/$user1->uid/edit", $edit, t('Save'));
+    $this->assertRaw(t('The changes have been saved.'));
+
     // Check that filling out a single password field does not validate.
     $edit = array();
     $edit['pass[pass1]'] = '';
