--- link.module	(revision 56)
+++ link.module	(working copy)
@@ -642,6 +642,11 @@
         $url = $protocol ."://". $url;
       }
     }
+  } elseif ( $type == LINK_EMAIL) {
+    // Check to see if we need to specify "mailto:"
+	if ( preg_match("/^mailto:/", $url) === 0 ) {
+	  $url = "mailto:" . $url;
+	}
   }
 
   return $url;
@@ -681,13 +686,12 @@
   // The rest of the path for a standard URL.
   $end = $directories .'?'. $query .'?'. $anchor .'?'.'$/i';
 
-  $user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\'\[\]]+';
-  $email_pattern = '/^mailto:'. $user .'@'.'('. $domain .'|'. $ipv4 .'|'. $ipv6 .'|localhost)'. $query .'?$/';
-
   if (strpos($text, '<front>') === 0) {
     return LINK_FRONT;
   }
-  if (in_array('mailto', $allowed_protocols) && preg_match($email_pattern, $text)) {
+  /* check to see if it is an email, with our without mailto: */
+  $possible_email=preg_replace('/^mailto:/','',$text);
+  if (in_array('mailto', $allowed_protocols) && valid_email_address($possible_email) ) {
     return LINK_EMAIL;
   }
   if (preg_match($internal_pattern . $end, $text)) {
