Changeset 4074 in subversion


Ignore:
Timestamp:
Oct 11, 2010 3:19:50 AM (3 years ago)
Author:
alec
Message:
  • Add SASL proxy authentication for SMTP (#1486693)
Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r4067 r4074  
    2727- Prevent from inserting empty link when composing HTML message (#1486944) 
    2828- Add caching support in id2uid and uid2id functions (#1487019) 
     29- Add SASL proxy authentication for SMTP (#1486693) 
    2930 
    3031RELEASE 0.4.2 
  • trunk/roundcubemail/config/main.inc.php.dist

    r4059 r4074  
    117117// best server supported one) 
    118118$rcmail_config['smtp_auth_type'] = ''; 
     119 
     120// Optional SMTP authorization identifier to be used as authorization proxy 
     121$rcmail_config['smtp_authzid'] = null; 
    119122 
    120123// SMTP HELO host  
  • trunk/roundcubemail/program/include/rcube_smtp.php

    r4059 r4074  
    4545   * @param string User name 
    4646   * @param string Password 
     47   * @param string Optional authorization ID to be used as authorization proxy 
    4748   * 
    4849   * @return bool  Returns true on success, or false on error 
    4950   */ 
    50   public function connect($host=null, $port=null, $user=null, $pass=null) 
     51  public function connect($host=null, $port=null, $user=null, $pass=null, $authz=null) 
    5152  { 
    5253    $RCMAIL = rcmail::get_instance(); 
     
    6061    // let plugins alter smtp connection config 
    6162    $CONFIG = $RCMAIL->plugins->exec_hook('smtp_connect', array( 
    62       'smtp_server' => $host ? $host : $RCMAIL->config->get('smtp_server'), 
    63       'smtp_port'   => $port ? $port : $RCMAIL->config->get('smtp_port', 25), 
    64       'smtp_user'   => $user ? $user : $RCMAIL->config->get('smtp_user'), 
    65       'smtp_pass'   => $pass ? $pass : $RCMAIL->config->get('smtp_pass'), 
     63      'smtp_server'    => $host ? $host : $RCMAIL->config->get('smtp_server'), 
     64      'smtp_port'      => $port ? $port : $RCMAIL->config->get('smtp_port', 25), 
     65      'smtp_user'      => $user ? $user : $RCMAIL->config->get('smtp_user'), 
     66      'smtp_pass'      => $pass ? $pass : $RCMAIL->config->get('smtp_pass'), 
     67      'smtp_authzid'   => $authz ? $authz : $RCMAIL->config->get('smtp_authzid'), 
    6668      'smtp_auth_type' => $RCMAIL->config->get('smtp_auth_type'), 
    6769      'smtp_helo_host' => $RCMAIL->config->get('smtp_helo_host'), 
     
    106108    if($RCMAIL->config->get('smtp_debug')) 
    107109      $this->conn->setDebug(true, array($this, 'debug_handler')); 
    108      
     110 
    109111    // try to connect to server and exit on failure 
    110112    $result = $this->conn->connect($smtp_timeout); 
     
    121123    $smtp_auth_type = empty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type']; 
    122124 
     125    if (!empty($CONFIG['smtp_authzid'])) { 
     126      $smtp_authz = $smtp_user; 
     127      $smtp_user  = $CONFIG['smtp_authzid']; 
     128    } 
     129 
    123130    // attempt to authenticate to the SMTP server 
    124131    if ($smtp_user && $smtp_pass) 
     
    128135        $smtp_user = idn_to_ascii($smtp_user); 
    129136 
    130       $result = $this->conn->auth($smtp_user, $smtp_pass, $smtp_auth_type, $use_tls); 
     137      $result = $this->conn->auth($smtp_user, $smtp_pass, $smtp_auth_type, $use_tls, $smtp_authz); 
    131138 
    132139      if (PEAR::isError($result)) 
Note: See TracChangeset for help on using the changeset viewer.