summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-09-01 13:53:23 +0000
committerthomascube <thomas@roundcube.net>2006-09-01 13:53:23 +0000
commit8cb245c2787fbcb7786349bfbc2379a51c73f8e6 (patch)
tree0e7e07a550734fe0c32406e583f444b1f0d41ff2 /program/include/main.inc
parent3ea0e3202a73eb7efcbf0b825582a6d3504658aa (diff)
Correct creation of a message-id
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc27
1 files changed, 19 insertions, 8 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index ecf53b52d..921494829 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -519,14 +519,7 @@ function rcmail_create_user($user, $host)
if ($user_id = $DB->insert_id(get_sequence_name('users')))
{
- $mail_domain = $host;
- if (is_array($CONFIG['mail_domain']))
- {
- if (isset($CONFIG['mail_domain'][$host]))
- $mail_domain = $CONFIG['mail_domain'][$host];
- }
- else if (!empty($CONFIG['mail_domain']))
- $mail_domain = $CONFIG['mail_domain'];
+ $mail_domain = rcmail_mail_domain($host);
if ($user_email=='')
$user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain);
@@ -1646,6 +1639,24 @@ function rcmail_current_username($attrib)
}
+// return the mail domain configured for the given host
+function rcmail_mail_domain($host)
+ {
+ global $CONFIG;
+
+ $domain = $host;
+ if (is_array($CONFIG['mail_domain']))
+ {
+ if (isset($CONFIG['mail_domain'][$host]))
+ $domain = $CONFIG['mail_domain'][$host];
+ }
+ else if (!empty($CONFIG['mail_domain']))
+ $domain = $CONFIG['mail_domain'];
+
+ return $domain;
+ }
+
+
// return code for the webmail login form
function rcmail_login_form($attrib)
{