Ticket #1484614 (closed Patches: fixed)
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
Note: See
TracTickets for help on using
tickets.
