IMP for virtual domains

jimmy@firstlink.com.au jimmy@firstlink.com.au
Fri, 25 Jan 2002 22:30:19 +1100


Hi everyone,

I recently install Imp3.0 + horde 2.0 on our sun cobalt server, just modified a 
few line of the codes, and make all webmail hosts pointed to the horde 
directory, now it can serve webmail for all the virtual domains in this server, 
I found this is very handy for ISPs, here I wanna share my experience with 
everyone, GREAT JOB GUYS!!! I love IMP and looking forward for IMP + Turba 
integrated.

in servers.php:

//This extracts the domain name like webmail.example.com to example.com
$this_domain=substr(getenv('HTTP_HOST'),strpos(getenv('HTTP_HOST'),'.')+1);
//append mail host to domain, most server with mail like mail.example.com
$this_mail_server='mail.'.$this_domain;
$this_mail_protocol='imap';
$this_mail_port=143;
$this_mail_folder='';
$this_mail_namespace='';
$this_mail_smtphost='localhost';
$this_mail_realm='webmail.'.$this_domain;

$servers[$this_domain] = array(
        'name' => $this_domain,
        'server' => $this_mail_server,
        'protocol' => $this_mail_protocol,
        'port' => $this_mail_port,
        'folders' => $this_mail_folder,
        'namespace' => $this_mail_namespace,
        'maildomain' => $this_domain,
        'smtphost' => $this_mail_smtphost,
        'realm' => $this_mail_realm,
        }

The above script detects the domain name and sets the right server properties.

another change that i found useful was modify trailer.txt and compose.php make 
it subs the virtual domain name into the trailer.txt.
in my trailer.txt:
--------------------------------------------------------
This mail sent through MY_WEBMAIL_HOST webmail service

in compose.php at line 674 I add this code:
$trailer =ereg_replace('MY_WEBMAIL_HOST', substr( getenv('HTTP_HOST'), strpos
(getenv('HTTP_HOST'), '.') + 1), $trailer);

the above subs. MY_WEBMAIL_HOST with the virtual domain.

hope someone would find this useful.

jim






--------------------------------------------------------
This mail sent through firstlink.com.au webmail service