[imp] multiple domains using preferred option in servers.php
eculp at encontacto.net
eculp at encontacto.net
Thu Dec 26 07:08:53 PST 2002
Quoting Jordi <jordi@sirt.es>:
| Hi all,
|
| I'm running IMP 3.1 in a Red Hat 8 .
|
| I want that depending on the url ( webmail.domain1.com or
| webmail.domain2.com) , IMP select the right server from servers.php:
| I read in the conf.php the next thing:
| //If the server
| list is hidden then you can use the
| // 'preferred'
| mechanism to auto-select from it based on an HTTP
| // virtualhost
| or another piece of data.
| So i think use vhost is not needed...
| The problem is that I dont understand how "preferred" works. Can u help me??
Jordi,
This has probably been answered but if not you could also try changing the
server to a $vdomain variable. Something like the following might work.
/* vdomain is used for dynamic configuration */
$vdomain = strtolower(preg_replace('/^mail\.|^www\./i', '', \
$_SERVER['HTTP_HOST']));
$servers['imap'] = array(
'name' => $vdomain,
'name' => 'localhost',
'server' => $vdomain,
'protocol' => 'imap',
'port' => 143,
'folders' => 'INBOX.',
'namespace' => '',
'maildomain' => $vdomain,
'smtphost' => $vdomain,
'realm' => '',
'preferred' => $vdomain,
'quota' => array(
'driver' => 'courier',
'params' => array(
'login' => '',
'password' => ''
)
)
);
Of course you would probably want to change or possibly eliminate the
replacement in the $vdomain assignment on the first line. A simple
$vdomain = $_SERVER['HTTP_HOST'] may work for you.
ed
-------------------------------------------------
More information about the imp
mailing list