Changeset 34 in subversion


Ignore:
Timestamp:
Oct 14, 2005 6:57:02 AM (8 years ago)
Author:
sparc
Message:

added smtp auth method setting through config file

Location:
trunk/roundcubemail
Files:
2 edited

Legend:

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

    r24 r34  
    4343$rcmail_config['smtp_port'] = 25; 
    4444 
    45 // SMTP username (if required) 
     45// SMTP username (if required) if you use %u as the username RoundCube 
     46// will use the current username for login 
    4647$rcmail_config['smtp_user'] = ''; 
    4748 
    48 // SMTP password (if required) 
     49// SMTP password (if required) if you use %p as the password RoundCube 
     50// will use the current user's password for login 
    4951$rcmail_config['smtp_pass'] = ''; 
     52 
     53// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use 
     54// best server supported one) 
     55$rcmail_config['smtp_auth_type'] = ''; 
    5056 
    5157// Log sent messages 
  • trunk/roundcubemail/program/include/rcube_smtp.inc

    r25 r34  
    7373      return FALSE; 
    7474      } 
    75  
    76  
     75       
    7776    // attempt to authenticate to the SMTP server 
    7877    if ($CONFIG['smtp_user'] && $CONFIG['smtp_pass']) 
    7978      { 
    80       if (PEAR::isError($SMTP_CONN->auth($CONFIG['smtp_user'], $CONFIG['smtp_pass']))) 
     79      if ($CONFIG['smtp_user'] == '%u') 
     80                $smtp_user = $_SESSION['username']; 
     81      else 
     82                $smtp_user = $CONFIG['smtp_user']; 
     83         
     84          if ($CONFIG['smtp_pass'] == '%p') 
     85                $smtp_pass = decrypt_passwd($_SESSION['password']); 
     86      else 
     87                $smtp_pass = $CONFIG['smtp_pass']; 
     88 
     89          $smtp_auth_type = smpty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type']; 
     90                 
     91      if (PEAR::isError($SMTP_CONN->auth($smtp_user, $smtp_pass, $smtp_auth_type))) 
    8192        { 
    8293        smtp_reset(); 
Note: See TracChangeset for help on using the changeset viewer.