Index: wp-login.php
===================================================================
--- wp-login.php	(revision 35948)
+++ wp-login.php	(working copy)
@@ -282,10 +282,12 @@
 
 	if ( empty( $_POST['user_login'] ) ) {
 		$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or email address.'));
-	} elseif ( strpos( $_POST['user_login'], '@' ) ) {
+	} elseif ( is_email( $_POST['user_login'] ) ) {
 		$user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
 		if ( empty( $user_data ) )
-			$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
+		  $user_data = get_user_by( 'login', trim( $_POST['user_login'] ) );
+		if ( empty( $user_data ) )
+			$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that username or email address.'));
 	} else {
 		$login = trim($_POST['user_login']);
 		$user_data = get_user_by('login', $login);
