Track message disposition notification flag and headers

release-0.6
thomascube 17 years ago
parent 1107480192
commit ed54070eb5

@ -939,7 +939,7 @@ class rcube_imap
/**
* Check if the given message ID is part of the current search set
*
* @return True on match or if no search request is stored
* @return boolean True on match or if no search request is stored
*/
function in_searchset($msgid)
{
@ -1290,7 +1290,7 @@ class rcube_imap
* Set message flag to one or several messages
*
* @param mixed Message UIDs as array or as comma-separated string
* @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT
* @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
* @return boolean True on success, False on failure
*/
function set_flag($uids, $flag)

@ -96,17 +96,21 @@ class iilBasicHeader{
var $messageID;
var $size;
var $encoding;
var $charset;
var $ctype;
var $flags;
var $timestamp;
var $f;
var $seen;
var $deleted;
var $recent;
var $answered;
var $junk;
var $internaldate;
var $is_reply;
var $references;
var $mdn_to;
var $mdn_sent = false;
var $is_reply = false;
var $seen = false;
var $deleted = false;
var $recent = false;
var $answered = false;
var $junk = false;
}
@ -1240,7 +1244,7 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false){
/* FETCH date,from,subject headers */
$key="fh".($c++);
$prefix=$uidfetch?" UID":"";
$request=$key.$prefix." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCES)])\r\n";
$request=$key.$prefix." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCES DISPOSITION-NOTIFICATION-TO)])\r\n";
if (!fputs($fp, $request)) return false;
do{
@ -1307,6 +1311,7 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false){
$result[$id]->ctype = str_replace("\n", " ", $headers["content-type"]);
$result[$id]->in_reply_to = ereg_replace("[\n<>]",'', $headers['in-reply-to']);
$result[$id]->references = $headers["references"];
$result[$id]->mdn_to = $headers["disposition-notification-to"];
list($result[$id]->ctype, $ctype_add) = explode(";", $headers["content-type"]);
@ -1369,10 +1374,6 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false){
$flags_a = explode(" ", $flags_str);
//echo "<!-- ID: $id FLAGS: ".implode(",", $flags_a)." //-->\n";
$result[$id]->seen = false;
$result[$id]->recent = false;
$result[$id]->deleted = false;
$result[$id]->answered = false;
if (is_array($flags_a)){
reset($flags_a);
while (list($key,$val)=each($flags_a)){
@ -1380,8 +1381,9 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false){
else if (strcasecmp($val, "Deleted")==0) $result[$id]->deleted=true;
else if (strcasecmp($val, "Recent")==0) $result[$id]->recent = true;
else if (strcasecmp($val, "Answered")==0) $result[$id]->answered = true;
else if (strcasecmp($val, "\$MDNSent")==0) $result[$id]->mdn_sent = true;
}
$result[$id]->flags=$flags_str;
$result[$id]->flags = $flags_a;
}
// if time is gmt...
@ -1510,13 +1512,14 @@ function iil_C_ModFlag(&$conn, $mailbox, $messages, $flag, $mod){
$fp = $conn->fp;
$flags=array(
"SEEN"=>"\\Seen",
"DELETED"=>"\\Deleted",
"RECENT"=>"\\Recent",
"ANSWERED"=>"\\Answered",
"DRAFT"=>"\\Draft",
"FLAGGED"=>"\\Flagged"
);
"SEEN"=>"\\Seen",
"DELETED"=>"\\Deleted",
"RECENT"=>"\\Recent",
"ANSWERED"=>"\\Answered",
"DRAFT"=>"\\Draft",
"FLAGGED"=>"\\Flagged",
"MDNSENT"=>"\$MDNSent"
);
$flag=strtoupper($flag);
$flag=$flags[$flag];
if (iil_C_Select($conn, $mailbox)){

@ -72,6 +72,10 @@ if ($_GET['_uid'])
// give message uid to the client
$OUTPUT->set_env('uid', $MESSAGE['UID']);
$OUTPUT->set_env('safemode', intval($_GET['_safe']));
// check for unset disposition notification
if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent)
$OUTPUT->set_env('mdn_request', true);
$next = $prev = -1;
// get previous, first, next and last message UID

Loading…
Cancel
Save