Changeset d359dcb in github


Ignore:
Timestamp:
Jul 26, 2012 10:54:12 AM (10 months ago)
Author:
bes.internal <bes.internal@…>
Children:
6d12536
Parents:
5bc1233
Message:

use in parse_host HTTP_HOST for %d
Use in parse_host function for domain resolve HTTP_HOST not hostname.
add %t for hostname without first part
For example roundcube box backend (rc.somedomain.tld) for reverse proxy on real domain (mail.example.com)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • config/main.inc.php.dist

    rb1f30d8 rd359dcb  
    6969// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls:// 
    7070// Supported replacement variables: 
    71 // %n - http hostname ($_SERVER['SERVER_NAME']) 
    72 // %d - domain (http hostname without the first part) 
     71// %n - hostname ($_SERVER['SERVER_NAME']) 
     72// %t - hostname without the first part 
     73// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) 
    7374// %s - domain name after the '@' from e-mail address provided at login screen 
    74 // For example %n = mail.domain.tld, %d = domain.tld 
     75// For example %n = mail.domain.tld, %t = domain.tld 
    7576$rcmail_config['default_host'] = ''; 
    7677 
     
    136137// Supported replacement variables: 
    137138// %h - user's IMAP hostname 
    138 // %n - http hostname ($_SERVER['SERVER_NAME']) 
    139 // %d - domain (http hostname without the first part) 
     139// %n - hostname ($_SERVER['SERVER_NAME']) 
     140// %t - hostname without the first part 
     141// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) 
    140142// %z - IMAP domain (IMAP hostname without the first part) 
    141 // For example %n = mail.domain.tld, %d = domain.tld 
     143// For example %n = mail.domain.tld, %t = domain.tld 
    142144$rcmail_config['smtp_server'] = ''; 
    143145 
     
    268270// Supported replacement variables: 
    269271// %h - user's IMAP hostname 
    270 // %n - http hostname ($_SERVER['SERVER_NAME']) 
    271 // %d - domain (http hostname without the first part) 
     272// %n - hostname ($_SERVER['SERVER_NAME']) 
     273// %t - hostname without the first part 
     274// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) 
    272275// %z - IMAP domain (IMAP hostname without the first part) 
    273 // For example %n = mail.domain.tld, %d = domain.tld 
     276// For example %n = mail.domain.tld, %t = domain.tld 
    274277$rcmail_config['username_domain'] = ''; 
    275278 
     
    281284// %d - domain (http hostname without the first part) 
    282285// %z - IMAP domain (IMAP hostname without the first part) 
    283 // For example %n = mail.domain.tld, %d = domain.tld 
     286// For example %n = mail.domain.tld, %t = domain.tld 
    284287$rcmail_config['mail_domain'] = ''; 
    285288 
     
    533536  // Replacement variables supported in host names: 
    534537  // %h - user's IMAP hostname 
    535   // %n - http hostname ($_SERVER['SERVER_NAME']) 
    536   // %d - domain (http hostname without the first part) 
     538  // %n - hostname ($_SERVER['SERVER_NAME']) 
     539  // %t - hostname without the first part 
     540  // %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) 
    537541  // %z - IMAP domain (IMAP hostname without the first part) 
    538   // For example %n = mail.domain.tld, %d = domain.tld 
     542  // For example %n = mail.domain.tld, %t = domain.tld 
    539543  'hosts'         => array('directory.verisign.com'), 
    540544  'port'          => 389, 
  • program/include/rcube_utils.php

    r09e5fc9 rd359dcb  
    617617        // %n - host 
    618618        $n = preg_replace('/:\d+$/', '', $_SERVER['SERVER_NAME']); 
    619         // %d - domain name without first part, e.g. %n=mail.domain.tld, %d=domain.tld 
    620         $d = preg_replace('/^[^\.]+\./', '', $n); 
     619        // %t - host name without first part, e.g. %n=mail.domain.tld, %t=domain.tld 
     620        $t = preg_replace('/^[^\.]+\./', '', $n); 
     621        // %d - domain name without first part 
     622        $d = preg_replace('/^[^\.]+\./', '', $_SERVER['HTTP_HOST']); 
    621623        // %h - IMAP host 
    622624        $h = $_SESSION['storage_host'] ? $_SESSION['storage_host'] : $host; 
     
    633635        } 
    634636 
    635         $name = str_replace(array('%n', '%d', '%h', '%z', '%s'), array($n, $d, $h, $z, $s[2]), $name); 
     637        $name = str_replace(array('%n', '%t', '%d', '%h', '%z', '%s'), array($n, $t, $d, $h, $z, $s[2]), $name); 
    636638        return $name; 
    637639    } 
Note: See TracChangeset for help on using the changeset viewer.