* a delivery backend.
*
* @author Marc Groot Koerkamp
- * @copyright © 1999-2009 The SquirrelMail Project Team
+ * @copyright 1999-2012 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
$cnt = count($header);
$hdr_s = '';
for ($i = 0 ; $i < $cnt ; $i++) {
- $hdr_s .= $this->foldLine($header[$i], 78);
+ $hdr_s .= $this->foldLine($header[$i]);
}
$header = $hdr_s;
$header .= $rn; /* One blank line to separate mimeheader and body-entity */
/* Create a message-id */
$message_id = 'MESSAGE ID GENERATION ERROR! PLEASE CONTACT SQUIRRELMAIL DEVELOPERS';
if (empty($rfc822_header->message_id)) {
- $message_id = '<';
- /* user-specifc data to decrease collision chance */
- $seed_data = $username . '.';
- $seed_data .= (!empty($REMOTE_PORT) ? $REMOTE_PORT . '.' : '');
- $seed_data .= (!empty($REMOTE_ADDR) ? $REMOTE_ADDR . '.' : '');
- /* add the current time in milliseconds and randomness */
- $seed_data .= uniqid(mt_rand(),true);
- /* put it through one-way hash and add it to the ID */
- $message_id .= md5($seed_data) . '.squirrel@' . $SERVER_NAME .'>';
+ $message_id = '<'
+ . md5(GenerateRandomString(16, '', 7) . uniqid(mt_rand(),true))
+ . '.squirrel@' . $SERVER_NAME .'>';
}
/* Make an RFC822 Received: line */
case 'From':
$hdr_s .= $header[$i];
break;
- default: $hdr_s .= $this->foldLine($header[$i], 78); break;
+ default: $hdr_s .= $this->foldLine($header[$i]); break;
}
}
$header = $hdr_s;
// if we found the beginning of an encoded word,
// we want to break BEFORE the token
//
- if (preg_match('/^(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)/Ui',
+ if (preg_match('/^(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)/i',
substr($header, $pos))) {
$pos--;
}
//
else if (strlen($header) > $hard_wrap
&& ($end_pos = strpos(substr($header, $hard_wrap), '?=')) !== FALSE
- && preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)$/Ui',
+ && preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)$/i',
substr($header, 0, $hard_wrap + $end_pos + 2),
$matches)) {