Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php	(revision 30055)
+++ src/wp-includes/formatting.php	(working copy)
@@ -2146,19 +2146,20 @@
 		return apply_filters( 'is_email', false, $email, 'local_invalid_chars' );
 	}
 
-	// DOMAIN PART
-	// Test for sequences of periods
-	if ( preg_match( '/\.{2,}/', $domain ) ) {
+	// Test for sequences of periods in either the local part or domain part
+	if ( preg_match( '/\.{2,}/', $email) ) {
 		/** This filter is documented in wp-includes/formatting.php */
 		return apply_filters( 'is_email', false, $email, 'domain_period_sequence' );
 	}
 
-	// Test for leading and trailing periods and whitespace
-	if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain ) {
+	// Test for leading and trailing periods and whitespace in both local and domain parts
+	if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain || trim( $local, " \t\n\r\0\x0B." ) !== $local ) {
 		/** This filter is documented in wp-includes/formatting.php */
 		return apply_filters( 'is_email', false, $email, 'domain_period_limits' );
 	}
 
+	// DOMAIN PART
+
 	// Split the domain into subs
 	$subs = explode( '.', $domain );
 
Index: tests/phpunit/tests/formatting/IsEmail.php
===================================================================
--- tests/phpunit/tests/formatting/IsEmail.php	(revision 30053)
+++ tests/phpunit/tests/formatting/IsEmail.php	(working copy)
@@ -22,7 +22,9 @@
 			'http://bob.example.com/',
 			"sif i'd give u it, spamer!1",
 			"com.exampleNOSPAMbob",
-			"bob@your mom"
+			"bob@your mom",
+			".bad.@example.com",
+			"two..periods@example.com"
 			);
 		foreach ($data as $datum) {
 			$this->assertFalse(is_email($datum), $datum);
Index: tests/phpunit/tests/post/guid.php
===================================================================
