--- gnupg-1.4.13/g10/misc.c	2012-12-20 12:22:27.000000000 -0500
+++ gnupg-1.4.13-modified/g10/misc.c	2013-03-05 03:12:07.166027420 -0500
@@ -1166,21 +1166,51 @@
 has_invalid_email_chars (const char *s)
 {
   int at_seen=0;
+  int in_quoted=0;
   const char *valid_chars=
     "01234567890_-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+  const char *valid_local_chars=
+    "0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'*+/=?^`|~{}";
 
-  for ( ; *s; s++ )
+  /* Verify we have txt, and the first character is valid */
+  if( s == NULL || *s == '.' || *s == '@' ) 
+    return 1;
+  if( *s == '"')
     {
-      if ( *s & 0x80 )
+      in_quoted = 1;
+      s++;
+    }
+
+  for ( ; *s; s++ ) 
+    {
+      if ( (*s & 0x80) )
         continue; /* We only care about ASCII.  */
-      if ( *s == '@' )
-        at_seen=1;
-      else if ( !at_seen && !( !!strchr( valid_chars, *s ) || *s == '+' ) )
-        return 1;
       else if ( at_seen && !strchr( valid_chars, *s ) )
         return 1;
+      else if ( !! strchr( valid_local_chars, *s ) )
+        continue;
+      else if ( in_quoted )
+        {
+          if ( *s == '"' )
+            {
+              if ( *(++s) == '@' )
+                at_seen=1;
+              else
+                return 1;
+            }
+          else if ( *s == '\\' )
+            {
+              ++s;
+              if ( *s < 33 && *s > 126  )
+                 return 1;
+            }
+          else if ( ! ( *s >= 33 && *s <= 126 && *s != 34 && *s != 92 ) )
+            return 1;
+         }
+      else if ( *s == '@' )
+        at_seen=1;
     }
-  return 0;
+  return !at_seen;
 }
 
 
@@ -1192,11 +1222,10 @@
   return !( !name
             || !*name
             || has_invalid_email_chars (name)
-            || string_count_chr (name,'@') != 1
             || *name == '@'
             || name[strlen(name)-1] == '@'
             || name[strlen(name)-1] == '.'
-            || strstr (name, "..") );
+            );
 }
 
 
