Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.752
diff -u -p -r1.752 common.inc
--- includes/common.inc	16 Jan 2008 10:37:30 -0000	1.752
+++ includes/common.inc	23 Jan 2008 15:42:49 -0000
@@ -807,19 +807,22 @@ function t($string, $args = array(), $la
  * Verify the syntax of the given e-mail address.
  *
  * Empty e-mail addresses are allowed. See RFC 2822 for details.
- *
+ * Valid formats: "display name" <addr-spec> / addr-spec.
+ * 
  * @param $mail
  *   A string containing an e-mail address.
  * @return
  *   TRUE if the address is in a valid format.
  */
 function valid_email_address($mail) {
+  $name = '((?:"[^\"\f\n\r\t\v]+" <))?';
+  $angle = '(?(1)>)';
   $user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
   $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.?)+';
   $ipv4 = '[0-9]{1,3}(\.[0-9]{1,3}){3}';
   $ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}';
 
-  return preg_match("/^$user@($domain|(\[($ipv4|$ipv6)\]))$/", $mail);
+  return preg_match("/^$name$user@($domain|(\[($ipv4|$ipv6)\]))$angle$/", $mail);
 }
 
 /**
