Changeset 3484 in subversion
- Timestamp:
- Apr 12, 2010 7:12:37 AM (3 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 edited
-
INSTALL (modified) (1 diff)
-
program/lib/Mail/mime.php (modified) (4 diffs)
-
program/steps/mail/func.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/INSTALL
r3340 r3484 18 18 * PEAR packages distributed with Roundcube or external: 19 19 - MDB2 2.5.0 or newer 20 - Mail_Mime 1. 6.1or newer20 - Mail_Mime 1.7.0 or newer 21 21 - Net_SMTP 1.4.2 or newer 22 22 * php.ini options (see .htaccess file): -
trunk/roundcubemail/program/lib/Mail/mime.php
r3340 r3484 1029 1029 * 1030 1030 * @param array $xtra_headers Assoc array with any extra headers (optional) 1031 * (Don't set Content-Type for multipart messages here!) 1031 1032 * @param bool $overwrite Overwrite already existing headers. 1032 1033 * @param bool $skip_content Don't return content headers: Content-Type, … … 1065 1066 unset($headers['Content-Transfer-Encoding']); 1066 1067 unset($headers['Content-Disposition']); 1068 } else if (!empty($this->_build_params['ctype'])) { 1069 $headers['Content-Type'] = $this->_build_params['ctype']; 1067 1070 } 1068 1071 … … 1076 1079 * 1077 1080 * @param array $xtra_headers Assoc array with any extra headers (optional) 1081 * (Don't set Content-Type for multipart messages here!) 1078 1082 * @param bool $overwrite Overwrite the existing headers with new. 1079 1083 * @param bool $skip_content Don't return content headers: Content-Type, … … 1109 1113 1110 1114 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; 1111 1163 } 1112 1164 -
trunk/roundcubemail/program/steps/mail/func.inc
r3479 r3484 1438 1438 'Message-ID' => sprintf('<%s@%s>', md5(uniqid('rcmail'.mt_rand(),true)), $RCMAIL->config->mail_domain($_SESSION['imap_host'])), 1439 1439 'X-Sender' => $identity['email'], 1440 'Content-Type' => 'multipart/report; report-type=disposition-notification',1441 1440 ); 1442 1441 … … 1461 1460 1462 1461 $compose->headers($headers); 1462 $compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification')); 1463 1463 $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n")); 1464 1464 $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline');
Note: See TracChangeset
for help on using the changeset viewer.
