diff -urbNP ubercart.orig/uc_cart/uc_cart.module ubercart/uc_cart/uc_cart.module
--- ubercart.orig/uc_cart/uc_cart.module	2011-05-22 04:06:14.000000000 +0200
+++ ubercart/uc_cart/uc_cart.module	2011-05-23 13:36:01.000000000 +0200
@@ -1190,7 +1190,7 @@
   // Logic to create new user if necessary:
   if ($order->uid == 0) {
     // Check for an existing user account with the e-mail address from checkout.
-    $result = db_query("SELECT uid FROM {users} WHERE mail = '%s'", $order->primary_email);
+    $result = db_query("SELECT uid FROM {users} WHERE LOWER(mail) = LOWER('%s')", $order->primary_email);

     // If it was found, update the order.
     if ($account = db_fetch_object($result)) {
diff -urbNP ubercart.orig/uc_order/uc_order.admin.inc ubercart/uc_order/uc_order.admin.inc
--- ubercart.orig/uc_order/uc_order.admin.inc	2011-05-22 04:06:14.000000000 +0200
+++ ubercart/uc_order/uc_order.admin.inc	2011-05-23 13:37:39.000000000 +0200
@@ -852,7 +852,7 @@
     if (!valid_email_address($email)) {
       $output .= t('Invalid e-mail address.') .'<br />';
     }
-    $result = db_query("SELECT uid, mail FROM {users} WHERE mail = '%s'", $email);
+    $result = db_query("SELECT uid, mail FROM {users} WHERE LOWER(mail) = LOWER('%s')", $email);
     if ($user = db_fetch_object($result)) {
       $output .= t('An account already exists for that e-mail.') .'<br /><br />';
       $output .= '<b>'. t('Use this account now?') .'</b><br />'
