Index: fb_user.install
===================================================================
--- fb_user.install	(revision 1773)
+++ fb_user.install	(working copy)
@@ -6,6 +6,9 @@
 function fb_user_install() {
   // Create tables.
   drupal_install_schema('fb_user');
+
+  // Change size of users.mail column
+  fb_user_update_6000();
 }
 
 
@@ -57,5 +60,15 @@
   return $ret;
 }
 
+function fb_user_update_6000() {
+  $ret = array();
+  if (variable_get('fb_user_use_proxied_email', TRUE)) {
+    // Make mail column longer to support http://wiki.developers.facebook.com/index.php/Proxied_Email
+    // db_change_column fails.  http://drupal.org/node/429786
+    //db_change_column($ret, 'users', 'mail', 'mail', 'varchar', array('length' => 255, 'not null' => TRUE, 'default' => ''));
+    $ret[] = update_sql("ALTER TABLE {users} MODIFY mail varchar(255)");
+  }
+  return $ret;
+}
 
 ?>
\ No newline at end of file
Index: fb.module
===================================================================
--- fb.module	(revision 1773)
+++ fb.module	(working copy)
@@ -742,6 +742,7 @@
                                                     'pic_big',
                                                     'pic_square',
                                                     'profile_update_time',
+                                                    'proxied_email',
                                                     'status',
                                                     ));
       // Update cache with recent results.
Index: fb_user.module
===================================================================
--- fb_user.module	(revision 1773)
+++ fb_user.module	(working copy)
@@ -693,6 +693,10 @@
   if (!$account) {
     // Create a new user in our system
 
+    // learn some details from facebook
+    $infos = fb_users_getInfo(array($fbu), $fb);
+    $config['info'] = $infos[0];
+
     // We need a username that will not collide with any already in our
     // system.  Could use $authname, but this will be just slightly more
     // user-friendly.
@@ -707,9 +711,15 @@
 					      'fb' => $GLOBALS['fb'],
 					      'fb_app' => $fb_app),
 			$config);
+
+    // use http://wiki.developers.facebook.com/index.php/Proxied_Email if mail not known
+    if (!isset($config['mail']) && variable_get('fb_user_use_proxied_email', TRUE)) {
+      $config['mail'] = $config['info']['proxied_email'];
+    }
     
     // TODO: double-check that username is not taken.
     $user_default = array('name' => $config['username'],
+                          'mail' => $config['mail'],
                           'pass' => user_password(),
                           'init' => db_escape_string($config['username']),
                           'status' => 1,
