Changeset 3484 in subversion


Ignore:
Timestamp:
Apr 12, 2010 7:12:37 AM (3 years ago)
Author:
alec
Message:
  • Fix regression in disposition-notification (#1486623)
Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/INSTALL

    r3340 r3484  
    1818* PEAR packages distributed with Roundcube or external: 
    1919   - MDB2 2.5.0 or newer 
    20    - Mail_Mime 1.6.1 or newer 
     20   - Mail_Mime 1.7.0 or newer 
    2121   - Net_SMTP 1.4.2 or newer 
    2222* php.ini options (see .htaccess file): 
  • trunk/roundcubemail/program/lib/Mail/mime.php

    r3340 r3484  
    10291029     * 
    10301030     * @param array $xtra_headers Assoc array with any extra headers (optional) 
     1031     *                            (Don't set Content-Type for multipart messages here!) 
    10311032     * @param bool  $overwrite    Overwrite already existing headers. 
    10321033     * @param bool  $skip_content Don't return content headers: Content-Type, 
     
    10651066            unset($headers['Content-Transfer-Encoding']); 
    10661067            unset($headers['Content-Disposition']); 
     1068        } else if (!empty($this->_build_params['ctype'])) { 
     1069            $headers['Content-Type'] = $this->_build_params['ctype']; 
    10671070        } 
    10681071 
     
    10761079     * 
    10771080     * @param array $xtra_headers Assoc array with any extra headers (optional) 
     1081     *                            (Don't set Content-Type for multipart messages here!) 
    10781082     * @param bool  $overwrite    Overwrite the existing headers with new. 
    10791083     * @param bool  $skip_content Don't return content headers: Content-Type, 
     
    11091113 
    11101114        return $ret; 
     1115    } 
     1116 
     1117    /** 
     1118     * Sets message Content-Type header. 
     1119     * Use it to build messages with various content-types e.g. miltipart/raport 
     1120     * not supported by _contentHeaders() function. 
     1121     * 
     1122     * @param string $type   Type name 
     1123     * @param array  $params Hash array of header parameters 
     1124     * 
     1125     * @return void 
     1126     * @access public 
     1127     * @since 1.7.0 
     1128     */ 
     1129    function setContentType($type, $params = array()) 
     1130    { 
     1131        $header = $type; 
     1132 
     1133        $eol = !empty($this->_build_params['eol']) 
     1134            ? $this->_build_params['eol'] : "\r\n"; 
     1135 
     1136        // add parameters 
     1137        $token_regexp = '#([^\x21,\x23-\x27,\x2A,\x2B,\x2D' 
     1138            . ',\x2E,\x30-\x39,\x41-\x5A,\x5E-\x7E])#'; 
     1139        if (is_array($params)) { 
     1140            foreach ($params as $name => $value) { 
     1141                if ($name == 'boundary') { 
     1142                    $this->_build_params['boundary'] = $value; 
     1143                } 
     1144                if (!preg_match($token_regexp, $value)) { 
     1145                    $header .= ";$eol $name=$value"; 
     1146                } else { 
     1147                    $value = addcslashes($value, '\\"'); 
     1148                    $header .= ";$eol $name=\"$value\""; 
     1149                } 
     1150            } 
     1151        } 
     1152 
     1153        // add required boundary parameter if not defined 
     1154        if (preg_match('/^multipart\//i', $type)) { 
     1155            if (empty($this->_build_params['boundary'])) { 
     1156                $this->_build_params['boundary'] = '=_' . md5(rand() . microtime());               
     1157            } 
     1158 
     1159            $header .= ";$eol boundary=\"".$this->_build_params['boundary']."\""; 
     1160        } 
     1161 
     1162        $this->_build_params['ctype'] = $header; 
    11111163    } 
    11121164 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r3479 r3484  
    14381438      'Message-ID' => sprintf('<%s@%s>', md5(uniqid('rcmail'.mt_rand(),true)), $RCMAIL->config->mail_domain($_SESSION['imap_host'])), 
    14391439      'X-Sender' => $identity['email'], 
    1440       'Content-Type' => 'multipart/report; report-type=disposition-notification', 
    14411440    ); 
    14421441     
     
    14611460     
    14621461    $compose->headers($headers); 
     1462    $compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification')); 
    14631463    $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n")); 
    14641464    $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); 
Note: See TracChangeset for help on using the changeset viewer.