Index: wp-comments-post.php
===================================================================
--- wp-comments-post.php	(revision 17175)
+++ wp-comments-post.php	(working copy)
@@ -87,6 +87,17 @@
 
 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
 
+$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
+$commentdata['comment_agent']     = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
+$commentdata['comment_date']     = current_time('mysql');
+$commentdata['comment_date_gmt'] = current_time('mysql', 1);
+
+$comment_approved = wp_allow_comment($commentdata);
+if( !$user->ID && get_user_by( 'email', $comment_author_email ) && 'spam' !== $comment_approved )
+	$comment_approved = 0;
+
+$commentdata['comment_approved'] = $comment_approved;
+
 $comment_id = wp_new_comment( $commentdata );
 
 $comment = get_comment($comment_id);
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 17175)
+++ wp-includes/comment.php	(working copy)
@@ -1322,17 +1322,9 @@
 	$commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
 	$parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
 	$commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
-
-	$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
-	$commentdata['comment_agent']     = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
-
-	$commentdata['comment_date']     = current_time('mysql');
-	$commentdata['comment_date_gmt'] = current_time('mysql', 1);
-
+	
 	$commentdata = wp_filter_comment($commentdata);
 
-	$commentdata['comment_approved'] = wp_allow_comment($commentdata);
-
 	$comment_ID = wp_insert_comment($commentdata);
 
 	do_action('comment_post', $comment_ID, $commentdata['comment_approved']);
