diff --git a/openid_connect.module b/openid_connect.module
index 80d1f89..96761cb 100644
--- a/openid_connect.module
+++ b/openid_connect.module
@@ -807,6 +807,12 @@ function openid_connect_complete_authorization($client, $tokens, &$destination)
     $account_is_new = FALSE;
   }
   else {
+    // Check whether the e-mail address is valid.
+    if (!filter_var($userinfo['mail'], FILTER_VALIDATE_EMAIL)) {
+      drupal_set_message(t('The e-mail address is not valid: @email', array('@email' => $userinfo['email'])), 'error');
+
+      return FALSE;
+    }
     // Check whether there is an e-mail address conflict.
     if (user_load_by_mail($userinfo['email'])) {
       drupal_set_message(t('The e-mail address is already taken: @email', array('@email' => $userinfo['email'])), 'error');
