diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-06-07 09:49:19 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-06-07 09:49:19 +0000 |
| commit | 4ab046ac04ad0ccec15a7f953893785af92315f5 (patch) | |
| tree | ee10450f0013a64f4540f81a17d34269bb2a0bea | |
| parent | f4fcb1079bc825a330297a2bd28d82cb31febe08 (diff) | |
- support dynamic hostname variables in 'username_domain' option
git-svn-id: https://svn.roundcube.net/trunk@3724 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/config/main.inc.php.dist | 5 | ||||
| -rw-r--r-- | roundcubemail/program/include/rcmail.php | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/roundcubemail/config/main.inc.php.dist b/roundcubemail/config/main.inc.php.dist index 34a976306..991d757a7 100644 --- a/roundcubemail/config/main.inc.php.dist +++ b/roundcubemail/config/main.inc.php.dist @@ -180,6 +180,11 @@ $rcmail_config['des_key'] = 'rcmail-!24ByteDESkey*Str'; // Automatically add this domain to user names for login // Only for IMAP servers that require full e-mail addresses for login // Specify an array with 'host' => 'domain' values to support multiple hosts +// Supported replacement variables: +// %h - user's IMAP hostname +// %n - http hostname ($_SERVER['SERVER_NAME']) +// %d - domain (http hostname without the first part) +// For example %n = mail.domain.tld, %d = domain.tld $rcmail_config['username_domain'] = ''; // This domain will be used to form e-mail addresses of new users diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php index 20b7bf7c9..d644f4f09 100644 --- a/roundcubemail/program/include/rcmail.php +++ b/roundcubemail/program/include/rcmail.php @@ -597,9 +597,9 @@ class rcmail // Check if we need to add domain if (!empty($config['username_domain']) && !strpos($username, '@')) { if (is_array($config['username_domain']) && isset($config['username_domain'][$host])) - $username .= '@'.$config['username_domain'][$host]; + $username .= '@'.rcube_parse_host($config['username_domain'][$host]); else if (is_string($config['username_domain'])) - $username .= '@'.$config['username_domain']; + $username .= '@'.rcube_parse_host($config['username_domain']); } // try to resolve email address from virtuser table |
