[imp] Multiple Domains
Thomas O'Brien
thomas at creativebusinessystems.com
Thu May 13 07:21:14 PDT 2004
Jan,
Set $conf['hooks']['vinfo'] = true; in /horde/imp/config/conf.php. Then edit
the sample _imp_hook_vinfo example section in /horde/config/hooks.php to
look something like this:
if (!function_exists('_imp_hook_vinfo')) {
function _imp_hook_vinfo($type = 'username')
{
global $conf, $imp;
$vdomain = strtolower(eregi_replace('^mail\.|^www\.|^www\.mail\.','',
$_SERVER['HTTP_HOST']));
if ($type == 'username') {
return $_SESSION['imp']['user'] . '@' . $vdomain;
} elseif ($type == "vdomain") {
return $vdomain;
} else {
return new PEAR_Error('invalid type: ' . $type);
}
}
}
Note that the line that starts with $vdomain= should not wrap. Now when a
user goes to:
http://www.domain1.com the logon screen will append @domain1.com to the
username. I've also declared $vdomain=
strtolower(eregi_replace('^mail\.|^www\.|^www\.mail\.','',$_SERVER['HTTP_HOS
T'])); in /horde/imp/config/server.php so I can set the maildomain =
$vdomain
Thomas
-----Original Message-----
From: imp-bounces at lists.horde.org [mailto:imp-bounces at lists.horde.org] On
Behalf Of Jan Tammen
Sent: Thursday, May 13, 2004 5:37 AM
To: imp at lists.horde.org
Subject: [imp] Multiple Domains
Bonjour.
I'm trying to offer webmail for different users in different domains (I'm
using "virtual domains" with Postfix, Cyrus IMAP, the accounts are stored in
a database using webcyradmin) on one server / IMP intallation.
Currently, I've got the following setup:
http://webmail.domain1 - this is the "main"-domain.
A User user1 can log into the application there and mail correctly is sent
as coming from "user1 at domain1".
But now I've got users whose mail-addresses are e.g. user2 at domain2 or
user3 at domain3.
When they log into IMP via webmail.domain1 and send mail, it seems to origin
from user2 at domain1, which is obviuosly due to the "maildomain"-entry in the
servers.conf
If I set up webmail.domain2 and webmail.domain3, I could use different
server-entries to correctly set the "maildomain". But then users could still
go to webmail.server1, log in and send mail under an invalid address. The
same problem would exist with a server-selection on the login-page.
What I basically want:
- Have one login-page / installation for all domains
- After logging in, I would have to lookup the users' address and then
correctly set the "maildomain" (if it differs from the "main"-domain)
Any hints for that?
Merci.
--
IMP mailing list - Join the hunt: http://horde.org/bounties/#imp Frequently
Asked Questions: http://horde.org/faq/ To unsubscribe, mail:
imp-unsubscribe at lists.horde.org
More information about the imp
mailing list