Ticket #1484614 (closed Patches: fixed)

Opened 12 months ago

Last modified 5 months ago

Automatically escape domain\username to "domain\\username"

Reported by: jean Owned by:
Priority: 1 Milestone: 0.2-alpha
Component: IMAP connection Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

Login to some IMAP servers require to escape the username form domain\username to "domain\\username". See http://kbase.gfi.com/showarticle.asp?id=KBID002189

--- program/include/main.inc.dist       2007-10-15 11:12:35.000000000 +0200
+++ program/include/main.inc    2007-10-15 10:57:26.000000000 +0200
@@ -499,6 +499,12 @@
       $user .= '@'.$CONFIG['username_domain'];
     }
 
+  // Check if we need to escape domain\username
+  if ($CONFIG['username_escape'] && strstr($user, "\\"))
+    {
+    $user = str_replace("\\","\\\\",'"'.$user.'"');
+    }
+
 
   // query if user already registered
   $sql_result = $DB->query("SELECT user_id, username, language, preferences


--- config/main.inc.php.dist    2007-05-18 15:11:22.000000000 +0200
+++ config/main.inc.php 2007-10-15 10:56:36.000000000 +0200
@@ -49,6 +49,11 @@
 // Specify an array with 'host' => 'domain' values to support multiple hosts
 $rcmail_config['mail_domain'] = '';
 
+// Automatically escape domain\username to "domain\\username"
+// Only for IMAP servers that require "domain\\username" syntax
+// errors logmessage: BAD Protocol Error: "Expected SPACE not found"
+$rcmail_config['username_escape'] = TRUE;
+
 // Path to a virtuser table file to resolve user names and e-mail addresses
 $rcmail_config['virtuser_file'] = '';

Change History

Changed 8 months ago by seansan

  • milestone set to 0.1.1

review in 0.1.1

Changed 5 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Fixed in r1460.

Note: See TracTickets for help on using tickets.