/* Delete files that are uploaded for attaching
*/
function deleteAttachments($session) {
- global $username, $attachments, $attachment_dir;
+ global $username, $attachments, $attachment_dir, $data_dir;
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$rem_attachments = array();
}
}
$attachments = $rem_attachments;
+ setPref($data_dir, $username, 'attachments', serialize($attachments));
}
/* Return a nice MIME-boundary
$refer = "";
for ($i=1;$i<count($refs[0]);$i++) {
if (!empty($refs[0][$i])) {
- if (preg_match("/^References:(.+)$/", $refs[0][$i], $regs)) {
+ if (preg_match("/^References:(.+)$/UA", $refs[0][$i], $regs)) {
$refer = trim($regs[1]);
}
- else {
- $refer .= ' ' . trim($refs[0][$i]);
- }
+ else {
+ $refer .= ' ' . trim($refs[0][$i]);
+ }
+
}
}
+ $refer_a = explode(' ', $refer);
+ $refer = '';
+ foreach ($refer_a as $ref) {
+ $ref = trim($ref);
+ if ($ref{0} == '<' && $ref{(strlen($ref)-1)} == '>') {
+ $refer .= $ref . ' ';
+ }
+ }
$refer = trim($refer);
if (strlen($refer) > 2) {
$refer .= ' ' . $inreplyto;
if (isset($reply_id) && $reply_id) {
sqimap_mailbox_select ($imap_stream, $mailbox);
- sqimap_messages_flag ($imap_stream, $reply_id, $reply_id, 'Answered');
+ sqimap_messages_flag ($imap_stream, $reply_id, $reply_id, 'Answered', false);
/* Insert In-Reply-To and References headers if the
* message-id of the message we reply to is set (longer than "<>")