| | |
| | | } |
| | | } |
| | | |
| | | $sort_col = $_SESSION['sort_col']; |
| | | |
| | | // loop through message headers |
| | | foreach ($a_headers as $header) { |
| | | if (empty($header)) |
| | |
| | | else if ($col == 'size') |
| | | $cont = $RCMAIL->show_bytes($header->$col); |
| | | else if ($col == 'date') |
| | | $cont = $RCMAIL->format_date($header->date); |
| | | $cont = $RCMAIL->format_date($sort_col == 'arrival' ? $header->internaldate : $header->date); |
| | | else if ($col == 'folder') { |
| | | if ($last_folder !== $header->folder) { |
| | | $last_folder = $header->folder; |
| | |
| | | } |
| | | |
| | | foreach ($a_show_cols as $col) { |
| | | $label = ''; |
| | | $label = ''; |
| | | $sortable = false; |
| | | $rel_col = $col == 'date' && $sort_col == 'arrival' ? 'arrival' : $col; |
| | | |
| | | // get column name |
| | | switch ($col) { |
| | |
| | | $col_name = $list_menu; |
| | | break; |
| | | case 'fromto': |
| | | $label = $RCMAIL->gettext($smart_col); |
| | | $label = $RCMAIL->gettext($smart_col); |
| | | $col_name = rcube::Q($label); |
| | | break; |
| | | default: |
| | | $label = $RCMAIL->gettext($col); |
| | | $label = $RCMAIL->gettext($col); |
| | | $col_name = rcube::Q($label); |
| | | } |
| | | |
| | |
| | | $col_name = html::a(array( |
| | | 'href' => "./#sort", |
| | | 'class' => 'sortcol', |
| | | 'rel' => $col, |
| | | 'rel' => $rel_col, |
| | | 'title' => $RCMAIL->gettext('sortby') |
| | | ), $col_name); |
| | | } |
| | |
| | | $col_name = '<span class="' . $col .'">' . $col_name . '</span>'; |
| | | } |
| | | |
| | | $sort_class = $col == $sort_col && !$disabled_order ? " sorted$sort_order" : ''; |
| | | $sort_class = $rel_col == $sort_col && !$disabled_order ? " sorted$sort_order" : ''; |
| | | $class_name = $col.$sort_class; |
| | | |
| | | // put it all together |
| | |
| | | 'Message-ID' => $RCMAIL->gen_message_id(), |
| | | 'X-Sender' => $identity['email'], |
| | | 'References' => trim($message->headers->references . ' ' . $message->headers->messageID), |
| | | 'In-Reply-To' => $message->headers->messageID, |
| | | ); |
| | | |
| | | $report = "Final-Recipient: rfc822; {$identity['email']}\r\n" |
| | |
| | | $report .= "Reporting-UA: $agent\r\n"; |
| | | } |
| | | |
| | | $to = rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset); |
| | | $date = $RCMAIL->format_date($message->headers->date, $RCMAIL->config->get('date_long')); |
| | | $body = $RCMAIL->gettext("yourmessage") . "\r\n\r\n" . |
| | | "\t" . $RCMAIL->gettext("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" . |
| | | "\t" . $RCMAIL->gettext("subject") . ': ' . $message->subject . "\r\n" . |
| | | "\t" . $RCMAIL->gettext("date") . ': ' . $RCMAIL->format_date($message->headers->date, $RCMAIL->config->get('date_long')) . "\r\n" . |
| | | "\t" . $RCMAIL->gettext("to") . ": {$to}\r\n" . |
| | | "\t" . $RCMAIL->gettext("subject") . ": {$message->subject}\r\n" . |
| | | "\t" . $RCMAIL->gettext("date") . ": {$date}\r\n" . |
| | | "\r\n" . $RCMAIL->gettext("receiptnote"); |
| | | |
| | | $compose->headers($headers); |
| | | $compose->headers(array_filter($headers)); |
| | | $compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification')); |
| | | $compose->setTXTBody(rcube_mime::wordwrap($body, 75, "\r\n")); |
| | | $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); |
| | | |
| | | if ($RCMAIL->config->get('mdn_use_from')) { |
| | | $options['mdn_use_from'] = true; |
| | | } |
| | | // SMTP options |
| | | $options = array('mdn_use_from' => (bool) $RCMAIL->config->get('mdn_use_from')); |
| | | |
| | | $sent = $RCMAIL->deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options); |
| | | |