Configuring Uebimiau for Multiple Domains

In order to configure Uebimiau for multiple domains, we need to edit the config.php file located in the inc folder of your Uebimiau installation. We can either have an installation for each domain or set it up so that the user is able to select the domain from a drop down list. If we are clever, we can configure Uebimiau so that it selects the domain automatically.

If we are hosting multiple domains on a signle server, then all we need for the login is the username in the configuration file inc/config.php. The POP usernames and passwords are found in /etc/passwd or /etc/shadow and are those you defined from the Westhost Site Manager Email/FTP Configuration section.

If you have $mail_server_type = “DETECT”; then set

  1. $mail_detect_login_type = "%user%";

The user will have to enter a username of joe@domainx.com

If you have $mail_server_type = “ONE-FOR-ALL”; then set

  1. $one_for_all_login_type = "%user%";

The user will have to enter a username of joe@domainx.com

If you have $mail_server_type = “ONE-FOR-EACH”; then set

  1. "login_type" => "%user%",

The user will have to select the domain from a drop down menu and you will have to have one $mail_servers[] block for each domain.

However, if you use the php reserved variable $_SERVER['HTTP_HOST'] as shown below you will only need one $mail_servers[] block and uebimiau will automatically detect the domain so that the user will just have to enter their user ID. The code below will let you access your domain by either domain.com, www.domain.com or webmail.domain.com.

  1. $mail_servers[] = Array( //sample using POP3
  2. "domain" => str_replace("webmail.","",str_replace("www.","",$_SERVER['HTTP_HOST'])) ,
  3. "server" => "maindomain.com",
  4. "login_type" => "%user%",
  5. "protocol" => "POP3",
  6. "port" => "110",
  7. "folder_prefix" => "" //not used for pop3
  8. );

If you want email for joe@domain1.com and joe@domain2.com to be delivered to different users, then you will have to edit /etc/mail/virtusertable as described in this post or elsewhere in the Westhost forum. By default mail to joe@domain1.com and joe@domain2.com are delivered to user joe.